:root {
    /* Color Palette - Premium Dark Mode Default */
    --bg-primary: #08090c;
    --sidebar-bg: rgba(12, 14, 19, 0.65);
    --chat-bg: rgba(16, 18, 26, 0.45);
    --card-bg: rgba(22, 26, 36, 0.45);
    --border-color: rgba(255, 255, 255, 0.07);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-accent: #635bff;
    --accent-glow: rgba(99, 91, 255, 0.12);
    
    /* Bubbles */
    --user-bubble: #1e1b4b;
    --bot-bubble: rgba(28, 35, 49, 0.45);
}

[data-theme="light"] {
    /* Color Palette - Clean Light Mode */
    --bg-primary: #f8fafc;
    --sidebar-bg: rgba(241, 245, 249, 0.85);
    --chat-bg: rgba(255, 255, 255, 0.6);
    --card-bg: rgba(241, 245, 249, 0.7);
    --border-color: rgba(0, 0, 0, 0.07);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-accent: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.08);
    
    /* Bubbles */
    --user-bubble: #4f46e5;
    --bot-bubble: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease;
    position: relative;
}

/* Floating background blobs for high creativity */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: screen;
}
.orb-1 {
    top: -10%;
    right: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 91, 255, 0.2) 0%, transparent 80%);
    animation: floatOrb 18s infinite alternate ease-in-out;
}
.orb-2 {
    bottom: 10%;
    left: 10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 80%);
    animation: floatOrb 22s infinite alternate-reverse ease-in-out;
}
.orb-3 {
    top: 40%;
    left: 40%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.1) 0%, transparent 80%);
    animation: floatOrb 15s infinite alternate ease-in-out;
}

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

/* Full Dashboard Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Left Sidebar styling */
.sidebar-left {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    flex-direction: column;
    padding: 24px;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 24px;
    color: var(--text-accent);
    filter: drop-shadow(0 0 10px var(--text-accent));
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    flex: 1;
    margin-top: 32px;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
    margin-bottom: 16px;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--text-accent);
    box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.18);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.profile-avatar-generic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
}

.profile-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: var(--text-accent);
    color: white;
    transform: rotate(30deg);
}

/* Central Chat Wrapper */
.chat-wrapper {
    background: var(--chat-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid var(--border-color);
}

.app-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.therapist-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.therapist-avatar-generic {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 2px solid var(--text-accent);
    color: var(--text-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.therapist-status-wrapper {
    display: flex;
    flex-direction: column;
}

.therapist-name {
    font-size: 16px;
    font-weight: 700;
}

.therapist-status {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

/* Chat Messages */
.chat-history {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}
.chat-history::-webkit-scrollbar-track {
    background: transparent;
}
.chat-history::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.15);
    border-radius: 99px;
}

/* Welcome Gradient Banner */
.welcome-gradient-banner {
    background: linear-gradient(135deg, rgba(99, 91, 255, 0.12) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 8px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.welcome-gradient-banner h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-gradient-banner p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.date-divider {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 8px 0;
}

.message-row {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeInBubble 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

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

.bot-row {
    align-self: flex-start;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar {
    background: var(--text-accent);
    color: white;
}

.bot-avatar {
    background: var(--accent-glow);
    border: 1px solid var(--border-color);
    color: var(--text-accent);
}

.message-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-card {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.user-row .message-card {
    background: var(--user-bubble);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 0 16px rgba(99, 91, 255, 0.1);
}

.bot-row .message-card {
    background: var(--bot-bubble);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
    backdrop-filter: blur(10px);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.user-row .message-meta {
    justify-content: flex-end;
}

/* Badges Container */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
}

.badge-emotion { color: #f59e0b; }
.badge-intent { color: #a78bfa; }
.badge-lang { color: #3b82f6; }

/* Input Area styling */
.chat-input-area {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

.chat-form:focus-within {
    border-color: var(--text-accent);
    box-shadow: 0 0 15px rgba(99, 91, 255, 0.2);
}

.chat-form input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 10px 12px;
}

.btn-input-accessory {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-input-accessory:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-send {
    background: var(--text-accent);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px var(--text-accent);
}

.disclaimer-text {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
}

/* Right Sidebar (Insights) */
.sidebar-right {
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    overflow-y: auto;
}

.sidebar-right-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.widget-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.2s ease;
}

.widget-card:hover {
    transform: translateY(-2px);
}

.widget-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.widget-title i {
    color: var(--text-accent);
    margin-right: 4px;
}

.widget-title-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.insight-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.insight-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.intent-badge {
    background: var(--accent-glow);
    color: var(--text-accent);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(99, 91, 255, 0.2);
}

.progress-bar-container {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-val-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 2px;
}

/* Emotion Bars */
.emotion-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emotion-bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
}

.emotion-name {
    color: var(--text-secondary);
    font-weight: 500;
}

.emotion-value {
    font-weight: 600;
}

.mood-score-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
}

.chart-wrapper-small {
    height: 60px;
    width: 100%;
    margin-top: 10px;
}

.mood-svg-chart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Mindfulness Quote Card */
.mindfulness-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(99, 91, 255, 0.04) 100%);
    border: 1px dashed rgba(16, 185, 129, 0.25);
}

.mindfulness-quote {
    font-size: 13px;
    line-height: 1.5;
    font-style: italic;
    color: var(--text-secondary);
}

/* Accordion reference styling */
.references-wrapper {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.references-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.references-content {
    display: none;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--text-accent);
    padding: 6px 10px;
    border-radius: 4px;
    max-height: 100px;
    overflow-y: auto;
}

.references-content.show {
    display: block;
}

/* Mobile responsive helpers */
.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 240px 1fr;
    }
    .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    .sidebar-left {
        display: none;
    }
    .mobile-only {
        display: flex;
    }
}
