:root {
    --bg-color: #f8f9fa;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    --accent-primary: #9b8af4; 
    --accent-secondary: #ffb86c; 
    --accent-tertiary: #f1f5f9; 
    
    --orb-color-1: #9b8af4;
    --orb-color-2: #ffb86c;
    --orb-color-3: #ffffff;

    --bg-gradient-1: #e0e7ff;
    --bg-gradient-2: #fae8ff;
    --bg-gradient-3: #fff1f2;
}

[data-theme="dark"] {
    --bg-color: #0a0a0c;
    --text-primary: #f5f5f7;
    --text-secondary: #8e8e93;
    
    --glass-bg: rgba(25, 25, 28, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    
    --accent-primary: #6366f1; 
    --accent-secondary: #8b5cf6; 
    --accent-tertiary: #1c1c1e;
    
    --orb-color-1: #6366f1;
    --orb-color-2: #8b5cf6;
    --orb-color-3: #000000;

    --bg-gradient-1: rgba(99, 102, 241, 0.15);
    --bg-gradient-2: rgba(139, 92, 246, 0.15);
    --bg-gradient-3: rgba(0, 0, 0, 0);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    transition: background-color 0.5s ease, color 0.5s ease;
    position: relative;
}

.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    opacity: 0.5;
    will-change: transform;
}

.shape-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, var(--bg-gradient-1), transparent 70%); }
.shape-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: radial-gradient(circle, var(--bg-gradient-2), transparent 70%); animation-delay: -5s; }
.shape-3 { top: 40%; left: 40%; width: 40vw; height: 40vw; background: radial-gradient(circle, var(--bg-gradient-3), transparent 70%); animation-duration: 25s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.app-container {
    display: flex;
    height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    transition: all 0.2s ease-out;
    will-change: transform, opacity;
}

.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
}

.brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 3rem; }
.brand-icon { font-size: 1.5rem; }
.brand h1 { font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em; }

.nav-menu { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem;
    text-decoration: none; color: var(--text-secondary); border-radius: 16px;
    transition: all 0.2s ease; font-weight: 500;
}
.nav-item i { width: 20px; height: 20px; }
.nav-item:hover, .nav-item.active {
    background: rgba(155, 138, 244, 0.1); color: var(--accent-primary);
}

.sidebar-bottom { display: flex; align-items: center; justify-content: flex-start; }
.icon-btn {
    background: transparent; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 0.75rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s ease;
}
.icon-btn:hover { background: var(--glass-bg); color: var(--text-primary); }

.main-content {
    flex: 1; display: flex; flex-direction: column; gap: 1.5rem; z-index: 10; min-width: 0; min-height: 0;
}

.dashboard { display: flex; gap: 1.5rem; }
.greeting-area { flex: 1; padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.greeting-area h2 { font-size: 2rem; font-weight: 600; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-secondary); }

.widgets { display: flex; gap: 1.5rem; }
.widget { padding: 1.5rem; display: flex; flex-direction: column; justify-content: center; min-width: 180px; }
.time-widget { align-items: flex-end; }
.time { font-size: 1.75rem; font-weight: 600; }
.date { color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.25rem; }

.weather-widget { flex-direction: row; align-items: center; gap: 1rem; }
.weather-icon { width: 32px; height: 32px; color: var(--accent-secondary); }
.weather-info { display: flex; flex-direction: column; }
.temp { font-size: 1.25rem; font-weight: 600; }
.condition { color: var(--text-secondary); font-size: 0.875rem; }

.chat-interface {
    flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; min-height: 0;
}

.orb-container {
    display: flex; justify-content: center; align-items: center; padding: 2rem 0; height: 160px;
    transition: height 0.3s ease; flex-shrink: 0;
}
.ai-orb {
    position: relative; width: 80px; height: 80px; display: flex;
    justify-content: center; align-items: center; animation: levitate 4s ease-in-out infinite;
}
.orb-core {
    width: 40px; height: 40px; background: radial-gradient(circle, var(--orb-color-3), var(--orb-color-1));
    border-radius: 50%; box-shadow: 0 0 20px var(--orb-color-1); z-index: 3; transition: all 0.3s ease;
}
.orb-ring { position: absolute; border-radius: 50%; border: 2px solid transparent; z-index: 2; }
.ring-1 {
    width: 60px; height: 60px; border-top-color: var(--orb-color-2); border-bottom-color: var(--orb-color-1);
    animation: spin 3s linear infinite; opacity: 0.7;
}
.ring-2 {
    width: 80px; height: 80px; border-left-color: var(--orb-color-1); border-right-color: var(--orb-color-2);
    animation: spin-reverse 5s linear infinite; opacity: 0.5;
}

@keyframes levitate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes spin-reverse { 0% { transform: rotate(360deg); } 100% { transform: rotate(0deg); } }

.ai-orb.listening .orb-core {
    transform: scale(1.2); box-shadow: 0 0 40px var(--orb-color-2);
    background: radial-gradient(circle, var(--orb-color-3), var(--orb-color-2));
}
.ai-orb.listening .ring-1 { animation-duration: 1.5s; border-color: var(--orb-color-2); }
.ai-orb.listening .ring-2 { animation-duration: 2.5s; border-color: var(--orb-color-2); }

.ai-orb.speaking .orb-core { animation: pulse 1.5s ease-in-out infinite alternate; }
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 20px var(--orb-color-1); }
    100% { transform: scale(1.1); box-shadow: 0 0 35px var(--orb-color-1); }
}

.chat-history {
    flex: 1; padding: 0 2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1.5rem;
    scroll-behavior: smooth; scrollbar-width: none; 
    -webkit-overflow-scrolling: touch;
}
.chat-history::-webkit-scrollbar { display: none; }

.message {
    display: flex; gap: 1rem; max-width: 80%; opacity: 0; transform: translateY(20px);
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.message.user-message { align-self: flex-end; flex-direction: row-reverse; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--glass-bg);
    border: 1px solid var(--glass-border); display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.message.user-message .avatar { background: var(--accent-primary); color: white; }

.bubble {
    padding: 1rem 1.25rem; border-radius: 18px; background: var(--glass-bg);
    border: 1px solid var(--glass-border); font-size: 0.95rem; line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.message.user-message .bubble {
    background: var(--accent-primary); color: white; border: none; border-bottom-right-radius: 4px;
}
.message.ai-message .bubble { border-bottom-left-radius: 4px; }

.typing-indicator { display: flex; gap: 4px; padding: 0.5rem 0; }
.dot {
    width: 6px; height: 6px; background: var(--text-secondary); border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

.input-area { padding: 1.5rem 2rem; display: flex; gap: 1rem; align-items: center; flex-shrink: 0; }
.input-wrapper {
    flex: 1; position: relative; border-radius: 24px; background: var(--glass-bg);
    border: 1px solid var(--glass-border); box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}
.input-wrapper:focus-within {
    border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(155, 138, 244, 0.2);
}

#chat-input {
    width: 100%; padding: 1rem 1.5rem; background: transparent; border: none;
    outline: none; color: var(--text-primary); font-family: inherit; font-size: 1rem;
}
#chat-input::placeholder { color: var(--text-secondary); }

.action-btn {
    width: 48px; height: 48px; border-radius: 50%; background: var(--glass-bg);
    border: 1px solid var(--glass-border); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.action-btn:hover { transform: scale(1.05); }
.voice-btn:hover { color: var(--accent-secondary); border-color: var(--accent-secondary); }

.send-btn { background: var(--accent-primary); color: white; border: none; }
.send-btn:hover { background: #8774e8; box-shadow: 0 4px 12px rgba(155, 138, 244, 0.4); }
.send-btn i { width: 18px; height: 18px; }

@media (max-width: 1024px) {
    .dashboard { flex-direction: column; }
    .widgets { width: 100%; }
    .widget { flex: 1; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; padding: 0.5rem; gap: 0.5rem; }
    .sidebar { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; padding: 1rem; height: auto; }
    .brand { margin-bottom: 0; }
    .nav-menu { flex-direction: row; justify-content: center; gap: 0.5rem; }
    .nav-item span { display: none; }
    .chat-history { padding: 0 1rem; }
    .input-area { padding: 1rem; }
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
    z-index: 100; transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 0; border: none;
}
.auth-modal.hidden { opacity: 0; visibility: hidden; }

.auth-content {
    background: var(--glass-bg); padding: 3rem; border-radius: 24px;
    border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
    text-align: center; max-width: 400px; width: 90%;
    display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}
.auth-content .brand-icon.large { font-size: 3rem; animation: float 6s infinite alternate ease-in-out; }
.auth-content h2 { font-size: 1.8rem; font-weight: 600; }
.auth-content p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; }

.google-btn {
    display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.8rem 1.5rem;
    background: white; border: 1px solid #e2e8f0; border-radius: 30px;
    font-family: inherit; font-size: 1rem; font-weight: 500; color: #334155;
    cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.05); width: 100%;
}
[data-theme="dark"] .google-btn { background: #1e293b; border-color: #334155; color: #f1f5f9; }
.google-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* Sidebar Additions */
.new-chat-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.8rem; border-radius: 12px; background: var(--accent-primary);
    color: white; border: none; cursor: pointer; font-family: inherit;
    font-size: 0.95rem; font-weight: 500; transition: all 0.2s ease;
    margin-bottom: 1.5rem; width: 100%;
}
.new-chat-btn:hover { background: #8774e8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(155, 138, 244, 0.3); }
.new-chat-btn i { width: 18px; height: 18px; }

.chat-history-container {
    flex: 1; display: flex; flex-direction: column; overflow: hidden; margin-bottom: 1rem;
}
.history-title {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-secondary); margin-bottom: 0.8rem; font-weight: 600;
}
.sidebar-chat-list {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem;
    scrollbar-width: none;
}
.sidebar-chat-list::-webkit-scrollbar { display: none; }
.chat-list-item {
    display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem;
    border-radius: 12px; cursor: pointer; transition: all 0.2s ease;
    color: var(--text-secondary); font-size: 0.9rem;
}
.chat-list-item i { width: 16px; height: 16px; flex-shrink: 0; }
.chat-list-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item:hover, .chat-list-item.active {
    background: rgba(155, 138, 244, 0.1); color: var(--accent-primary);
}

.sidebar-bottom { flex-direction: column; align-items: stretch; gap: 1rem; }
.user-profile { display: flex; align-items: center; gap: 0.8rem; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-name { font-weight: 500; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-actions { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-start; }
.hidden { display: none !important; }

/* Toast Notifications */
.toast-container {
    position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 200;
}
.toast {
    display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.5rem;
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); color: var(--text-primary);
    transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 500; font-size: 0.95rem;
}
.toast.show { transform: translateX(0); }
.toast-success i { color: #10b981; }
.toast-error i { color: #ef4444; }
.toast-info i { color: #3b82f6; }

/* About Section */
.about-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 32px;
    position: relative;
    overflow: hidden;
}

.about-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
    cursor: default;
}

.feature-card i {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.feature-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-primary);
}
.feature-card:hover i {
    transform: scale(1.2);
    color: var(--accent-secondary);
}

.founder-section {
    display: inline-block;
    padding: 1.5rem 3rem;
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(155, 138, 244, 0.1), rgba(255, 184, 108, 0.1));
    border: 1px solid var(--glass-border);
}

.founder-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.founder-info p {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

@media (max-width: 768px) {
    .about-section { margin: 2rem 1rem; padding: 2rem 1rem; }
    .about-title { font-size: 2rem; }
}

/* Minimal Premium Interactions */
.hud-card {
    cursor: pointer;
}

.card-status {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-top: 0.5rem;
    min-height: 1.2rem;
    transition: opacity 0.3s ease;
}

.card-user-info {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.5rem;
}
.card-user-info img {
    width: 24px; height: 24px; border-radius: 50%;
}
.card-user-info span {
    font-size: 0.85rem; color: var(--text-secondary);
}

.login-success {
    border-color: #10b981 !important;
}

.syncing .sync-icon {
    animation: spin 1s linear infinite;
}

.pulse-active .mic-icon {
    color: var(--accent-secondary);
    animation: pulse 1s infinite alternate;
}

.optimizing {
    border-color: var(--accent-secondary) !important;
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
