/**
 * Neiroseti Mini App — Base Styles
 */

/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --bg: #000000;
    --bg-card: #141416;
    --bg-elevated: #1a1a1c;
    --bg-hover: #242426;
    
    --text: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #48484a;
    
    --accent: #6366f1;
    --accent-hover: #5558e3;
    --accent-glow: rgba(99, 102, 241, 0.25);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    
    /* Gradients */
    --grad-purple: linear-gradient(135deg, #8b5cf6, #6366f1);
    --grad-blue: linear-gradient(135deg, #3b82f6, #0ea5e9);
    --grad-green: linear-gradient(135deg, #10b981, #14b8a6);
    --grad-orange: linear-gradient(135deg, #f59e0b, #ef4444);
    --grad-pink: linear-gradient(135deg, #ec4899, #f43f5e);
    
    /* Typography */
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    
    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 100px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-spring: 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* ===== Layout ===== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
    padding-bottom: var(--space-3xl);
}

.page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-lg);
    padding-bottom: var(--space-3xl);
}

/* ===== Typography ===== */
h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text);
}

p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ===== Components: Cards ===== */
.card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.card-interactive {
    border: 1px solid var(--border);
    transition: transform var(--transition-fast), 
                border-color var(--transition-fast),
                background var(--transition-fast);
}

.card-interactive:active {
    transform: scale(0.98);
}

/* ===== Components: Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 48px;
    padding: 0 var(--space-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: transform var(--transition-fast), 
                opacity var(--transition-fast),
                background var(--transition-fast);
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:active {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
}

.btn-lg {
    height: 52px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-sm {
    height: 36px;
    padding: 0 var(--space-md);
    font-size: 13px;
}

/* ===== Components: Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); }
.badge-error { background: var(--error); }

/* ===== Animations ===== */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(8px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(16px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn var(--transition-slow) ease both;
}

.animate-fade-in-up {
    animation: fadeInUp var(--transition-slow) ease both;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Stagger */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ===== Utilities ===== */
.w-full { width: 100%; }
.text-center { text-align: center; }

/* ===== Safe Area ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .container,
    .page {
        padding-bottom: calc(var(--space-3xl) + env(safe-area-inset-bottom));
    }
}
