:root {
    --bg-dark: #050505;
    --card-bg: rgba(15, 15, 25, 0.6);
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --glow-purple: rgba(168, 85, 247, 0.4);
    --glow-cyan: rgba(6, 182, 212, 0.4);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --cursor-glow: rgba(6, 182, 212, 0.6);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Day Mode (Light Theme) */
body.light {
    --bg-dark: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --glass-border: rgba(0, 0, 0, 0.08);
    --cursor-glow: rgba(6, 182, 212, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
    cursor: none !important; /* Hide default cursor */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden; /* Sidebar + Main content will handle scroll */
    height: 100vh;
    display: flex;
}

/* 3D Background */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    perspective: 1000px;
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #050505 100%);
}

.bg-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    pointer-events: none;
    transition: transform 0.2s ease-out;
}

.sphere-1 { width: 600px; height: 600px; background: var(--accent-purple); top: -200px; left: -200px; }
.sphere-2 { width: 500px; height: 500px; background: var(--accent-cyan); bottom: -100px; right: -100px; }

/* Sidebar Navigation */
aside.sidebar {
    width: 280px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 100;
}

body.light aside.sidebar {
    background: rgba(255, 255, 255, 0.8);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

body.light .parallax-bg {
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #e2e8f0 100%);
}

body.light .glass-card {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light .search-box-3d, 
body.light .settings-input, 
body.light .settings-select {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light .nav-item:hover, 
body.light .nav-item.active {
    background: rgba(0, 0, 0, 0.02);
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 3rem;
    background: linear-gradient(to right, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.1);
}

.nav-item.active {
    border-left: 3px solid var(--accent-purple);
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.1) 0%, transparent 100%);
}

.nav-item * {
    user-select: none;
    pointer-events: none;
}

/* Main Content Area */
main {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 4rem;
    position: relative;
}

/* Header / Controls */
.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

/* 3D Search Container */
.search-wrapper {
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5vh;
}

.search-container {
    width: 100%;
    max-width: 700px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.search-container:hover {
    transform: rotateX(5deg) translateY(-5px);
}

.search-box-3d {
    width: 100%;
    padding: 1.5rem 2rem;
    padding-right: 5rem;
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    color: white;
    font-size: 1.25rem;
    outline: none;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 20px var(--glow-purple);
    transition: var(--transition);
}

.search-box-3d:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px var(--glow-cyan);
}

.neon-border {
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-cyan), var(--accent-purple));
    background-size: 200% 200%;
    z-index: -1;
    opacity: 0.3;
    animation: neonFlow 3s linear infinite;
}

@keyframes neonFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Suggestions Dropdown */
.suggestions-3d {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    display: none;
    overflow: hidden;
    z-index: 1000;
    transform: translateZ(50px);
}

.suggestion-item {
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.suggestion-item:hover {
    background: rgba(168, 85, 247, 0.1);
    transform: translateX(10px);
}

.suggestion-item .match {
    color: var(--accent-cyan);
    font-weight: 700;
    text-shadow: 0 0 10px var(--glow-cyan);
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 5rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-10px);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.glass-card h3 {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.glass-card h3 i {
    color: var(--accent-cyan);
}

/* Voice Animation */
.voice-pulse {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.voice-pulse:hover {
    background: rgba(255,255,255,0.1);
}

.voice-pulse.active {
    animation: pulseGlow 1.5s infinite;
    color: var(--accent-cyan);
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(6, 182, 212, 0); }
    100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

/* 3D Toggle Switch */
.switch-3d {
    position: relative;
    width: 60px;
    height: 30px;
    background: #1a1a2e;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.switch-3d.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-cyan);
}

.switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 0 10px var(--glow-purple);
}

.switch-3d.active .switch-knob {
    left: 32px;
    box-shadow: 0 0 15px var(--glow-cyan);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* Custom Cursor */
#custom-cursor {
    width: 20px;
    height: 20px;
    background: var(--accent-cyan);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
    box-shadow: 0 0 15px var(--accent-cyan), 0 0 30px var(--accent-purple);
    transform: translate3d(-100px, -100px, 0);
}

#custom-cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-cyan);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.5;
    transform: translate3d(-100px, -100px, 0);
    transition: transform 0.1s ease-out;
}

/* Page Visibility */
.page {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.page.active {
    display: block;
}

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

/* History Floating Cards */
.history-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.history-card:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 15px rgba(168, 85, 247, 0.1);
}

.history-card .keyword {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-card .timestamp {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 0.3rem;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.action-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.action-btn.star:hover, .action-btn.star.active {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.action-btn.delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.action-btn.search:hover {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
}

/* Settings Page Layout */
.settings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.settings-card {
    padding: 2rem;
}

.settings-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 1rem;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    box-shadow: 0 0 20px var(--glow-purple);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.settings-input, .settings-select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.settings-input:focus, .settings-select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.settings-select option {
    background: var(--bg-dark);
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.setting-title {
    font-weight: 600;
    font-size: 1rem;
}

.setting-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.color-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.active {
    border-color: white;
    box-shadow: 0 0 15px currentColor;
}

/* Settings Buttons */
.btn-primary {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--glow-purple);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    padding: 0.8rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Trending Dashboard Styles */
.trend-badge-up {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.trend-badge-down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.momentum-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.momentum-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.elite-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.elite-item:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.elite-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-cyan);
    opacity: 0.8;
    width: 30px;
    text-align: center;
}

/* Utility Classes for Settings */
.no-glow * {
    text-shadow: none !important;
    box-shadow: none !important;
}

.performance-mode .bg-sphere {
    display: none !important;
}

.performance-mode * {
    transition: none !important;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-green {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile */
@media (max-width: 900px) {
    aside.sidebar {
        display: none; /* In a real app we'd add a hamburger menu */
    }
    main { padding: 2rem; }
    .hero-title { font-size: 2.5rem; }
}
