:root {
    --color-primary: #5B8DEF;
    --color-primary-dark: #4A7DE0;
    --color-secondary: #8B7CF6;
    --color-accent: #4ECDC4;
    --color-success: #6BCB77;
    --color-warning: #FFD93D;
    --color-danger: #FF6B6B;
    --color-pink: #F687B3;
    --color-indigo: #8B7CF6;
    --color-amber: #F6AD55;
    --color-teal: #4ECDC4;

    --theme-accent: var(--color-primary);
    
    --color-text-primary: #2D3748;
    --color-text-secondary: #718096;
    --color-text-muted: #A0AEC0;

    --color-bg-gradient-start: #F8FAFC;
    --color-bg-gradient-end: #F1F5F9;
    --color-card-bg: rgba(255, 255, 255, 0.8);
    --color-sidebar-bg: rgba(255, 255, 255, 0.7);
    --color-header-bg: rgba(255, 255, 255, 0.7);
    
    --glass-border: rgba(255, 255, 255, 0.5);
    --blur-amount: 12px;

    --shadow-sm: 0 2px 8px rgba(91, 141, 239, 0.05);
    --shadow-md: 0 4px 20px rgba(91, 141, 239, 0.08);
    --shadow-lg: 0 10px 40px rgba(91, 141, 239, 0.12);
    --shadow-xl: 0 20px 60px rgba(91, 141, 239, 0.15);
    
    --shadow-card: var(--shadow-md);
    --shadow-card-hover: 0 12px 30px rgba(91, 141, 239, 0.15);
    --shadow-button: 0 4px 12px rgba(91, 141, 239, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-width: 280px;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--color-bg-gradient-start) 0%, var(--color-bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
}


::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #A0AEC0;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E0 transparent;
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(91, 141, 239, 0.3); }
    50% { box-shadow: 0 0 40px rgba(91, 141, 239, 0.5); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes breathe4_7_8 {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    25% { transform: scale(1.2); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
    75% { transform: scale(1.05); opacity: 0.85; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-150px) rotate(720deg); opacity: 0; }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-fadeIn {
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-scaleUp {
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-fadeInUp {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-sidebar-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--color-header-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-bottom: 1px solid var(--glass-border);
    z-index: 50;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content {
    flex: 1;
    padding: 32px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.sidebar-logo {
    padding: 24px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-button);
}

.logo-icon i {
    color: white;
    font-size: 1.25rem;
}

.logo-text h1,
.logo-text .logo-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 16px;
    margin-bottom: 8px;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(91, 141, 239, 0.08);
    color: var(--color-primary);
}

.nav-item:hover i {
    color: var(--color-primary);
}

/* --- COLOR WAYFINDING THEMES --- */
body.theme-blue { --theme-accent: var(--color-primary); --theme-glow: var(--color-primary); }
body.theme-purple { --theme-accent: var(--color-indigo); --theme-glow: var(--color-indigo); }
body.theme-teal { --theme-accent: var(--color-teal); --theme-glow: var(--color-teal); }
body.theme-pink { --theme-accent: var(--color-pink); --theme-glow: var(--color-pink); }
body.theme-green { --theme-accent: var(--color-success); --theme-glow: var(--color-success); }
body.theme-yellow { --theme-accent: var(--color-warning); --theme-glow: var(--color-warning); }
body.theme-slate { --theme-accent: var(--color-text-secondary); --theme-glow: var(--color-primary); }

.nav-item.active {
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--color-secondary) 100%);
    color: white !important;
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.2);
}

.nav-item.active i {
    color: white !important;
}

/* --- AMBIENT GLOW --- */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.3;
}

body.dark-mode .ambient-glow {
    opacity: 0.15;
}

.ambient-glow .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: orbFloat 20s ease-in-out infinite;
}

.ambient-glow .orb-1 {
    width: 600px;
    height: 600px;
    background: var(--theme-glow);
    top: -200px;
    right: -100px;
    opacity: 0.4;
}

.ambient-glow .orb-2 {
    width: 500px;
    height: 500px;
    background: var(--color-secondary);
    bottom: -150px;
    left: -100px;
    opacity: 0.3;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, 50px) scale(1.1); }
    66% { transform: translate(-30px, 20px) scale(0.9); }
}

/* --- COLORFUL KPI CARDS --- */
.kpi-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: var(--radius-xl);
    background: var(--color-card-bg);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-normal);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.kpi-card .stats-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.kpi-card .stats-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* KPI Tints - Light Mode */
.kpi-primary { background: rgba(91, 141, 239, 0.08); border-color: rgba(91, 141, 239, 0.2); }
.kpi-success { background: rgba(107, 203, 119, 0.08); border-color: rgba(107, 203, 119, 0.2); }
.kpi-accent { background: rgba(78, 205, 196, 0.08); border-color: rgba(78, 205, 196, 0.2); }
.kpi-warning { background: rgba(255, 217, 61, 0.08); border-color: rgba(255, 217, 61, 0.2); }
.kpi-secondary { background: rgba(139, 124, 246, 0.08); border-color: rgba(139, 124, 246, 0.2); }

/* KPI Tints - Dark Mode Overrides */
body.dark-mode .kpi-primary { background: rgba(91, 141, 239, 0.12); }
body.dark-mode .kpi-success { background: rgba(107, 203, 119, 0.12); }
body.dark-mode .kpi-accent { background: rgba(78, 205, 196, 0.12); }
body.dark-mode .kpi-warning { background: rgba(255, 217, 61, 0.12); }
body.dark-mode .kpi-secondary { background: rgba(139, 124, 246, 0.12); }

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.sidebar-user {
    padding: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.1) 0%, rgba(139, 124, 246, 0.1) 100%);
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: #F7FAFC;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: #EDF2F7;
    color: var(--color-text-primary);
}

.header-greeting h2,
.header-greeting .greeting-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.header-greeting p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: #F7FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    position: relative;
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: #EDF2F7;
    color: var(--color-text-primary);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--color-danger) 0%, #FF8E8E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    padding: 0 4px;
}

.btn-primary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-button);
    transition: all var(--transition-fast);
}

.btn-primary-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(91, 141, 239, 0.4);
}

.card {
    background: var(--color-card-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(91, 141, 239, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.card-title i {
    color: var(--color-primary);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(91, 141, 239, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #7B6CF6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 124, 246, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 124, 246, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, #3EBDBA 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, #FF5252 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #5BB967 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: white;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.15);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.mood-selector {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: #F7FAFC;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.mood-btn:hover {
    transform: scale(1.05);
    border-color: var(--color-primary);
}

.mood-btn.selected {
    transform: scale(1.1);
    border-color: var(--color-primary);
    background: rgba(91, 141, 239, 0.1);
}

.mood-btn .emoji {
    font-size: 2.5rem;
}

.mood-btn .label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.mood-btn-sm {
    padding: 10px 14px;
    border-radius: var(--radius-md);
}

.mood-btn-sm .emoji {
    font-size: 1.5rem;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #E2E8F0 0%, #EDF2F7 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.video-container.active {
    border: 3px solid var(--color-primary);
    box-shadow: 0 0 30px rgba(91, 141, 239, 0.3);
}

.video-container.emotion-happy {
    border-color: var(--color-success);
    box-shadow: 0 0 30px rgba(107, 203, 119, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

.video-container.emotion-neutral {
    border-color: var(--color-primary);
    box-shadow: 0 0 30px rgba(91, 141, 239, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

.video-container.emotion-stressed {
    border-color: var(--color-warning);
    box-shadow: 0 0 30px rgba(255, 217, 61, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

.video-container.emotion-tired {
    border-color: var(--color-secondary);
    box-shadow: 0 0 30px rgba(139, 124, 246, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-secondary);
}

.video-placeholder i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--color-text-muted);
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    display: flex;
    align-items: center;
    gap: 12px;
}

.emotion-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
}

.emotion-badge i {
    font-size: 1.25rem;
}

.emotion-badge .text {
    color: white;
}

.emotion-badge .text strong {
    display: block;
    font-size: 0.9rem;
}

.emotion-badge .text span {
    font-size: 0.75rem;
    opacity: 0.8;
}


.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
}

.chart-container-sm {
    height: 180px;
}


.cbt-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-normal);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.cbt-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.6);
}

.cbt-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cbt-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cbt-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.cbt-card-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.cbt-card-content {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.breathing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.breathing-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.2) 0%, rgba(139, 124, 246, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
    position: relative;
}

.breathing-circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--color-primary);
    opacity: 0.3;
}

.breathing-circle.active {
    animation: breathe 8s ease-in-out infinite;
}

.breathing-circle .text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    text-align: center;
}

.breathing-timer {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 24px;
}

.breathing-instruction {
    font-size: 1.25rem;
    color: var(--color-text-primary);
    margin-top: 16px;
    font-weight: 500;
}

.breathing-4-7-8 .breathing-circle.active {
    animation: breathe4_7_8 19s ease-in-out infinite;
}

.journal-entry {
    background: #F7FAFC;
    border-radius: var(--radius-md);
    padding: 16px;
    border-left: 4px solid var(--color-primary);
    transition: all var(--transition-fast);
}

.journal-entry:hover {
    background: #EDF2F7;
}

.journal-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.journal-entry-mood {
    display: flex;
    align-items: center;
    gap: 8px;
}

.journal-entry-mood .emoji {
    font-size: 1.25rem;
}

.journal-entry-mood .label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.journal-entry-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.journal-entry-content {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #EDF2F7;
}

.history-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #F7FAFC;
}

.history-table td {
    font-size: 0.875rem;
    color: var(--color-text-primary);
}

.history-table tr:hover td {
    background: #F7FAFC;
}

.history-mood {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.history-mood.happy {
    background: rgba(107, 203, 119, 0.15);
    color: #5BB967;
}

.history-mood.neutral {
    background: rgba(91, 141, 239, 0.15);
    color: var(--color-primary);
}

.history-mood.stressed {
    background: rgba(255, 217, 61, 0.15);
    color: #D4A900;
}

.history-mood.tired {
    background: rgba(139, 124, 246, 0.15);
    color: #7B6CF6;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #EDF2F7;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #F7FAFC;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 2px;
}

.settings-item-info p {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.toggle {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E0;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.article-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.article-image {
    height: 160px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-image i {
    font-size: 3rem;
    color: white;
    opacity: 0.9;
}

.article-content {
    padding: 20px;
}

.article-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(91, 141, 239, 0.1);
    color: var(--color-primary);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.confetti-particle {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti 1s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-primary {
    border-color: rgba(91, 141, 239, 0.3);
    border-top-color: var(--color-primary);
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-radius: inherit;
    z-index: 10;
}

.loading-overlay p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #F7FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon i {
    font-size: 2rem;
    color: var(--color-text-muted);
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .content {
        padding: 24px 16px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .header {
        padding: 0 16px;
    }

    .header-greeting h2 {
        font-size: 1.25rem;
    }

    .btn-primary-header span {
        display: none;
    }

    .mood-selector {
        gap: 10px;
    }

    .mood-btn {
        padding: 12px 14px;
    }

    .mood-btn .emoji {
        font-size: 2rem;
    }

    .breathing-circle {
        width: 140px;
        height: 140px;
    }
}

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

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow { box-shadow: var(--shadow-card); }

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- FONT SCALING Preferensi --- */
html.font-size-small { font-size: 14px; }
html.font-size-medium { font-size: 16px; }
html.font-size-large { font-size: 18px; }

/* --- SMOOTH TRANSITION FOR THEME SWITCH --- */
body, header, aside, .card, .settings-section, .nav-item, input, select, textarea, .settings-input, .settings-select, .history-table th, .history-table td, #notification-dropdown {
    transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}

/* --- MICRO-INTERACTIONS --- */
.btn:active, .nav-item:active, .mood-btn:active, .header-btn:active {
    transform: scale(0.96) !important;
}

/* --- DARK MODE CONFIGURATION --- */
body.dark-mode {
    --color-bg-gradient-start: #0F172A;
    --color-bg-gradient-end: #020617;
    --color-card-bg: rgba(30, 41, 59, 0.7);
    --color-sidebar-bg: rgba(15, 23, 42, 0.8);
    --color-header-bg: rgba(15, 23, 42, 0.8);
    
    --color-text-primary: #F8FAFC;
    --color-text-secondary: #94A3B8;
    --color-text-muted: #64748B;
    
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.7);
    
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-button: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode {
    background: radial-gradient(circle at top right, #1E1B4B, #0F172A 40%, #020617 100%);
    color: var(--color-text-primary);
}

body.dark-mode .card,
body.dark-mode .settings-section,
body.dark-mode .cbt-card,
body.dark-mode .relaxation-card,
body.dark-mode .article-card-edukasi,
body.dark-mode .stats-mini-card,
body.dark-mode .history-entry-card,
body.dark-mode .meditation-guide,
body.dark-mode .sound-card,
body.dark-mode .tip-card,
body.dark-mode .resource-card,
body.dark-mode .quick-read-card,
body.dark-mode .result-card {
    background: var(--color-card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
}

body.dark-mode .header {
    background: var(--color-header-bg);
    border-bottom: 1px solid var(--glass-border);
}

body.dark-mode .sidebar {
    background: var(--color-sidebar-bg);
    border-right: 1px solid var(--glass-border);
}

/* Global Dark Mode Fixes for White Components */
body.dark-mode .bg-white,
body.dark-mode #notification-dropdown,
body.dark-mode .modal-content,
body.dark-mode .bg-gray-50,
body.dark-mode .bg-gray-100,
body.dark-mode .bg-gray-200,
body.dark-mode .bg-slate-50,
body.dark-mode .bg-slate-100 {
    background-color: var(--color-card-bg) !important;
    color: var(--color-text-primary) !important;
}

body.dark-mode .border,
body.dark-mode .border-gray-100,
body.dark-mode .border-gray-200,
body.dark-mode .border-gray-300,
body.dark-mode .border-slate-100,
body.dark-mode .border-slate-200,
body.dark-mode .divide-y > * {
    border-color: var(--glass-border) !important;
}

body.dark-mode .text-slate-dark,
body.dark-mode .text-gray-900,
body.dark-mode .text-gray-800 {
    color: var(--color-text-primary) !important;
}

body.dark-mode .text-slate-cool,
body.dark-mode .text-gray-600,
body.dark-mode .text-gray-500 {
    color: var(--color-text-secondary) !important;
}

body.dark-mode .btn-outline {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}

body.dark-mode .btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border-color: var(--glass-border) !important;
    color: var(--color-text-primary) !important;
}

body.dark-mode .hover\:bg-gray-50:hover,
body.dark-mode .hover\:bg-gray-100:hover,
body.dark-mode .hover\:bg-slate-50:hover,
body.dark-mode .hover\:bg-slate-100:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .mood-btn {
    background-color: rgba(30, 41, 59, 0.5) !important;
    color: var(--color-text-secondary) !important;
}

body.dark-mode .mood-btn.selected {
    background-color: rgba(91, 141, 239, 0.2) !important;
    border-color: var(--color-primary) !important;
}

body.dark-mode .filter-btn,
body.dark-mode .history-filter-btn {
    background-color: rgba(30, 41, 59, 0.5) !important;
    color: var(--color-text-secondary) !important;
    border-color: transparent !important;
}

body.dark-mode .filter-btn:hover,
body.dark-mode .history-filter-btn:hover {
    background-color: rgba(91, 141, 239, 0.1) !important;
    color: var(--color-primary) !important;
}

body.dark-mode .filter-btn.active,
body.dark-mode .history-filter-btn.active {
    background-color: rgba(91, 141, 239, 0.2) !important;
    color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

/* Catch-all for any other white buttons/elements */
body.dark-mode button:not(.btn-primary):not(.btn-secondary):not(.btn-accent):not(.btn-danger):not(.btn-success):not(.btn-primary-header),
body.dark-mode .btn:not(.btn-primary):not(.btn-secondary):not(.btn-accent):not(.btn-danger):not(.btn-success):not(.btn-primary-header) {
    background-color: rgba(30, 41, 59, 0.5);
    color: var(--color-text-primary);
    border-color: var(--glass-border);
}

body.dark-mode button:hover:not(.btn-primary):not(.btn-secondary):not(.btn-accent):not(.btn-danger):not(.btn-success):not(.btn-primary-header) {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-primary);
}

body.dark-mode .nav-item.active {
    background: linear-gradient(135deg, var(--theme-accent) 0%, rgba(139, 124, 246, 0.4) 100%);
}

body.dark-mode .nav-item.active i {
    color: white !important;
}

body.dark-mode .menu-toggle,
body.dark-mode .header-btn {
    background: #334155;
    color: #F8FAFC;
}

body.dark-mode .menu-toggle:hover,
body.dark-mode .header-btn:hover {
    background: #475569;
    color: white;
}

body.dark-mode .settings-select,
body.dark-mode .settings-input,
body.dark-mode .form-input,
body.dark-mode .search-bar input {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

body.dark-mode .settings-select option {
    background: #1E293B;
    color: #F8FAFC;
}

body.dark-mode .history-table th {
    background: #0F172A;
    color: #94A3B8;
    border-bottom: 1px solid #334155;
}

body.dark-mode .history-table td {
    border-bottom: 1px solid #334155;
    color: #F8FAFC;
}

body.dark-mode .history-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

body.dark-mode .user-card {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .mood-btn {
    background: #0F172A;
    border-color: transparent;
    color: var(--color-text-secondary);
}

body.dark-mode .mood-btn:hover {
    border-color: var(--color-primary);
}

body.dark-mode .mood-btn.selected {
    background: rgba(91, 141, 239, 0.2);
    border-color: var(--color-primary);
}

body.dark-mode .bg-gray-50,
body.dark-mode .bg-gray-100 {
    background-color: #0F172A !important;
}

body.dark-mode .text-slate-dark,
body.dark-mode .text-gray-800 {
    color: #F8FAFC !important;
}

body.dark-mode .text-slate-cool,
body.dark-mode .text-gray-500,
body.dark-mode .text-gray-600 {
    color: #94A3B8 !important;
}

body.dark-mode .border-gray-50,
body.dark-mode .border-gray-100,
body.dark-mode .border-gray-200 {
    border-color: #334155 !important;
}

body.dark-mode #notification-dropdown {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.dark-mode #notification-dropdown .border-b {
    border-color: #334155;
}

body.dark-mode #notification-dropdown .hover\:bg-gray-50:hover {
    background-color: #334155 !important;
}

body.dark-mode .empty-state-icon,
body.dark-mode .history-empty-state .empty-icon {
    background: #0F172A;
}

body.dark-mode .meditation-guide {
    background: linear-gradient(135deg, rgba(139, 124, 246, 0.1) 0%, rgba(78, 205, 196, 0.1) 100%);
}

body.dark-mode .meditation-guide.active {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.2) 0%, rgba(139, 124, 246, 0.2) 100%);
}

body.dark-mode .cbt-card-icon,
body.dark-mode .sound-card .sound-icon {
    background: #0F172A;
    box-shadow: none;
}body.dark-mode .confirm-modal .modal-content {
    background: #1E293B;
    border: 1px solid #334155;
    color: #F8FAFC;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode .confirm-modal h3 {
    color: #F8FAFC;
}

body.dark-mode .confirm-modal p {
    color: #94A3B8;
}

body.dark-mode .confirm-modal input {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

/* --- PRINT & PDF LAYOUT --- */
@media print {
    .sidebar, .header, .btn, .history-filter-btn, .month-picker, .calendar-container, .export-card, .calendar-nav-btn, .month-picker select, .flex.gap-2 {
        display: none !important;
    }
    .main-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .content {
        padding: 0 !important;
    }
    .card {
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-bottom: 30px !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
}

/* Prevent transition flicker on page load */
body.preload, body.preload * {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
}
