@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* ============================================
   1. CSS VARIABLES - DESIGN TOKENS
   ============================================ */

:root {
    /* Backgrounds */
    --bg-primary: #F5F5F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #FAFAFA;

    /* Glass Effects */
    --glass-white: rgba(255, 255, 255, 0.72);
    --glass-light: rgba(255, 255, 255, 0.88);
    --glass-ultra-thin: rgba(255, 255, 255, 0.60);

    /* Accent Colors */
    --accent-blue: #007AFF;
    --accent-blue-hover: #0051D5;
    --accent-blue-light: rgba(0, 122, 255, 0.1);
    --accent-glow: rgba(0, 122, 255, 0.25);

    /* Status Colors */
    --success-green: #34C759;
    --success-green-bg: rgba(52, 199, 89, 0.1);
    --warning-orange: #FF9500;
    --warning-orange-bg: rgba(255, 149, 0, 0.1);
    --error-red: #FF3B30;
    --error-red-bg: rgba(255, 59, 48, 0.1);

    /* Text */
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #86868B;

    /* Borders */
    --border-light: rgba(0, 0, 0, 0.04);
    --border-medium: rgba(0, 0, 0, 0.08);
    --border-focus: rgba(0, 122, 255, 0.4);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    /* Transitions */
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.2s;
    --duration-slow: 0.3s;
}



/* ============================================
   2. RESET & BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: linear-gradient(135deg, #F5F5F7 0%, #E8E8EA 100%);
    color: var(--text-primary);
    line-height: 1.47;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */

.display-large {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.07;
    letter-spacing: -0.5px;
}

.display-medium {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.4px;
}

.title-1 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: 0.007em;
}

.title-2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: 0.011em;
}

.headline {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.29;
    letter-spacing: -0.022em;
}

.body {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.47;
    letter-spacing: -0.022em;
}

.subheadline {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.33;
    letter-spacing: -0.016em;
}

.footnote {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.38;
    letter-spacing: -0.008em;
}

.caption {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.33;
}

/* ============================================
   4. GLASS EFFECTS & MATERIALS
   ============================================ */

.glass-card {
    background: var(--glass-light);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border-light);
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.04),
        0 8px 24px -4px rgba(0, 0, 0, 0.06),
        0 2px 6px -2px rgba(0, 0, 0, 0.04);
}

.glass-ultra-thin {
    background: var(--glass-ultra-thin);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.elevated-card {
    background: var(--bg-secondary);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 12px 32px -8px rgba(0, 0, 0, 0.08),
        0 4px 16px -4px rgba(0, 0, 0, 0.04);
}

/* ============================================
   5. BUTTONS
   ============================================ */

.btn-primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    font-size: 17px;
    font-weight: 500;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-in-out);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow:
        0 2px 8px rgba(0, 122, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--glass-light);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 10px 21px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-in-out);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-blue-light);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ============================================
   6. FORM INPUTS
   ============================================ */

.input-field {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 17px;
    color: var(--text-primary);
    width: 100%;
    transition: all var(--duration-normal) ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow:
        0 0 0 4px var(--accent-blue-light),
        0 1px 2px rgba(0, 0, 0, 0.04);
}

.input-field::placeholder {
    color: var(--text-tertiary);
}

.input-field:read-only,
.input-field:disabled {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-color: var(--border-light);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.008em;
}

/* ============================================
   7. CARDS
   ============================================ */

.card-tahoe {
    background: var(--glass-light);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--duration-slow) var(--ease-in-out);
}

.card-tahoe:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.04),
        0 12px 32px -8px rgba(0, 0, 0, 0.10),
        0 4px 16px -4px rgba(0, 0, 0, 0.06);
}

/* ============================================
   8. ANIMATIONS
   ============================================ */

@keyframes scale-in {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-scale-in {
    animation: scale-in 0.4s var(--ease-out);
}

.animate-fade-in-up {
    animation: fade-in-up 0.4s var(--ease-out);
}

/* ============================================
   9. UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.mb-xs {
    margin-bottom: var(--spacing-xs);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.mb-2xl {
    margin-bottom: var(--spacing-2xl);
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.pb-lg {
    padding-bottom: var(--spacing-lg);
}

.pb-xl {
    padding-bottom: var(--spacing-xl);
}

.border-b {
    border-bottom: 1px solid var(--border-light);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.justify-end {
    justify-content: flex-end;
}

.gap-4 {
    gap: 16px;
}

.gap-6 {
    gap: 24px;
}

/* ============================================
   10. ACCESSIBILITY
   ============================================ */

*:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   12. LAYOUT (Desktop Default)
   ============================================ */

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

.content-area {
    margin-left: 260px;
    padding-top: 60px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.footer-tahoe {
    margin-left: 260px;
    background: var(--glass-light);
    border-top: 1px solid var(--border-light);
    padding: 20px 24px;
    backdrop-filter: blur(20px);
    transition: margin-left 0.3s ease;
}

/* ============================================
   11. RESPONSIVE DESIGN
   ============================================ */

/* Mobile Navigation Toggle */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Tablet & Mobile Styles */
@media (max-width: 1024px) {
    .sidebar-tahoe {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    }

    .sidebar-tahoe.active {
        transform: translateX(0);
    }

    .content-area,
    footer {
        margin-left: 0 !important;
        width: 100%;
    }

    .mobile-menu-btn {
        display: block;
    }

    .navbar-tahoe {
        padding: 0 16px;
    }
}

/* Mobile Specific */
@media (max-width: 768px) {
    .display-large {
        font-size: 40px;
    }

    .display-medium {
        font-size: 32px;
    }

    .title-1 {
        font-size: 24px;
    }

    .login-container,
    .signup-container {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .dashboard-container {
        padding: 16px;
    }

    .hero-section {
        padding: 24px;
    }

    .hero-title {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hidden {
    display: none !important;
}

/* ============================================
   FORM SECTIONS
   ============================================ */

.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    animation: fade-in-up 0.4s var(--ease-out);
}

.section-header {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header i {
    color: var(--accent-blue);
}

.form-group {
    margin-bottom: 16px;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 17px;
    font-weight: 600;
    margin-top: 24px;
    background: var(--success-green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-in-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover {
    background: #2ab84c;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
    transform: translateY(-1px);
}

/* ============================================
   TYPEAHEAD AUTOCOMPLETE
   ============================================ */

.twitter-typeahead {
    width: 100% !important;
    position: relative;
}

.tt-menu {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-top: 4px;
    padding: 4px 0;
    z-index: 9999 !important;
    position: absolute !important;
}

.tt-suggestion {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 15px;
    color: #000000;
    transition: background var(--duration-fast) ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-suggestion:hover,
.tt-suggestion.tt-cursor {
    background: #f5f5f5;
    color: #000000;
}

.tt-dataset {
    background: transparent;
}

.twitter-typeahead .input-field {
    background: var(--bg-primary);
}