:root {
    --bg-main: #09090b; /* zinc-950 */
    --bg-sheet: #18181b; /* zinc-900 */
    --bg-card: #09090b;
    --bg-input: #27272a; /* zinc-800 */
    --bg-header: rgba(9, 9, 11, 0.9);
    --text-main: #f8fafc;
    --text-muted: #a1a1aa; /* zinc-400 */
    --accent-blue: #3b82f6;
    --border-color: rgba(255, 255, 255, 0.08); /* faint border */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-sheet: rgba(255, 255, 255, 0.95);
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --bg-header: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-blue: #2563eb;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    overscroll-behavior-y: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input, textarea, select {
    -webkit-user-select: auto;
    user-select: auto;
}

/* Premium Minimalist Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(150, 150, 150, 0.2);
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(150, 150, 150, 0.4);
}

/* Global Text Effects */
h1, h2, h3, .text-pro-title {
    letter-spacing: -0.05em !important;
    line-height: 1.1;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-tech-blue {
    background-color: #1e40af;
}

.text-tech-blue {
    color: var(--accent-blue);
}

/* Theme Utilities */
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.border-main { border-color: var(--border-color); }

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(150, 150, 150, 0.2);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Premium Apple Glass Effect */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .glass-card:hover {
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.08);
}

.apple-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--border-color);
    transition: all 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .apple-glass {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.apple-glass:hover {
    background: var(--bg-card);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.theme-toggle-nav {
    width: 44px;
    height: 26px;
    border-radius: 999px;
    padding: 3px;
    background: rgba(150, 150, 150, 0.1);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-toggle-knob-nav {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-blue);
    position: absolute;
    top: 2px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

[data-theme="light"] .theme-toggle-knob-nav {
    transform: translateX(16px);
}

@media (max-width: 768px) {
    .mobile-hide { display: none !important; }
    .mobile-only { display: block !important; }
    .safe-bottom-padding { padding-bottom: calc(80px + var(--safe-bottom)); }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-header);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-top: 1px solid var(--border-color);
    display: none;
    z-index: 100;
    padding-bottom: var(--safe-bottom);
}

@media (max-width: 1024px) {
    .bottom-nav { display: flex; }
    main { padding-bottom: calc(75px + var(--safe-bottom)); }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active { color: var(--accent-blue); }
.nav-item svg { width: 24px; height: 24px; margin-bottom: 4px; }

/* Professional Header Effects */
.nav-link-pro {
    position: relative;
    padding-bottom: 4px;
}

.nav-link-pro::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-pro:hover::after { width: 100%; }

.search-input-pro:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: rgba(150, 150, 150, 0.15) !important;
}

.dropdown-animate {
    animation: dropdownFade 0.2s ease-out;
}

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

/* Settings Switch UI */
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-radius: 12px;
    transition: background 0.2s;
}

.settings-item:hover { background: rgba(255, 255, 255, 0.05); }

.switch-pro {
    width: 36px;
    height: 20px;
    background: rgba(150, 150, 150, 0.2);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.switch-pro-on { background: var(--accent-blue); }

.switch-knob {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-pro-on .switch-knob { transform: translateX(16px); }
