/* =============================================
   MindGreen — Final v2
   Sidebar Desktop · Bottom Bar Mobile
   Vibe: Playful Gen Z
   Anisa & Ricardo 2024
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --g1:        #0d5c35;
    --g2:        #1a7a4a;
    --g3:        #25a066;
    --g4:        #3dbf7e;
    --g5:        #a8e6c3;
    --g6:        #d4f5e4;
    --g7:        #edfbf3;
    --g8:        #f5fdf8;

    --pink:      #ff6b9d;
    --purple:    #a855f7;
    --blue:      #3b82f6;
    --yellow:    #fbbf24;
    --coral:     #ff7043;
    --cyan:      #06b6d4;

    --text1:     #0a1628;
    --text2:     #4a5568;
    --text3:     #94a3b8;
    --white:     #ffffff;
    --danger:    #ff4757;

    --sidebar-w: 240px;
    --card-bg:   rgba(255,255,255,0.9);
    --radius:    20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --shadow:    0 4px 24px rgba(0,0,0,0.07);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f0f4ff;
    color: var(--text1);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* Colorful background blobs */
body::before {
    content: '';
    position: fixed;
    top: -150px; right: -100px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(168,85,247,0.12), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: blobDrift 12s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    bottom: -100px; left: 200px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.10), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: blobDrift 15s ease-in-out infinite reverse;
}

a { text-decoration: none; color: inherit; }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes blobDrift {
    0%,100% { transform: translate(0,0) scale(1); }
    33%      { transform: translate(20px,-30px) scale(1.05); }
    66%      { transform: translate(-15px,20px) scale(0.97); }
}

@keyframes fadeInUp {
    from { opacity:0; transform:translateY(20px); }
    to   { opacity:1; transform:translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity:0; transform:translateX(-20px); }
    to   { opacity:1; transform:translateX(0); }
}

@keyframes fadeInRight {
    from { opacity:0; transform:translateX(20px); }
    to   { opacity:1; transform:translateX(0); }
}

@keyframes scaleIn {
    from { opacity:0; transform:scale(0.90); }
    to   { opacity:1; transform:scale(1); }
}

@keyframes popIn {
    0%   { opacity:0; transform:scale(0.7); }
    70%  { transform:scale(1.08); }
    100% { opacity:1; transform:scale(1); }
}

@keyframes float {
    0%,100% { transform:translateY(0); }
    50%      { transform:translateY(-6px); }
}

@keyframes wiggle {
    0%,100% { transform:rotate(0deg); }
    25%      { transform:rotate(-8deg); }
    75%      { transform:rotate(8deg); }
}

@keyframes typingBounce {
    0%,60%,100% { transform:translateY(0); opacity:0.35; }
    30%          { transform:translateY(-8px); opacity:1; }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%,100% { box-shadow:0 0 0 0 rgba(37,160,102,0.45); }
    50%      { box-shadow:0 0 0 12px rgba(37,160,102,0); }
}

.animate-up    { animation: fadeInUp   0.45s ease both; }
.animate-left  { animation: fadeInLeft 0.45s ease both; }
.animate-scale { animation: scaleIn    0.4s  ease both; }
.animate-pop   { animation: popIn      0.5s  cubic-bezier(0.34,1.56,0.64,1) both; }

.stagger > *:nth-child(1) { animation: fadeInUp 0.45s 0.05s ease both; }
.stagger > *:nth-child(2) { animation: fadeInUp 0.45s 0.12s ease both; }
.stagger > *:nth-child(3) { animation: fadeInUp 0.45s 0.19s ease both; }
.stagger > *:nth-child(4) { animation: fadeInUp 0.45s 0.26s ease both; }
.stagger > *:nth-child(5) { animation: fadeInUp 0.45s 0.33s ease both; }

/* =============================================
   LAYOUT — SIDEBAR + MAIN
   ============================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid rgba(0,0,0,0.06);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.05);
    animation: fadeInLeft 0.4s ease both;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--g3), var(--cyan));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(37,160,102,0.3);
    animation: float 3s ease-in-out infinite;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 17px;
    font-weight: 800;
    color: var(--text1);
    letter-spacing: -0.3px;
}

.sidebar-logo-text span {
    background: linear-gradient(135deg, var(--g2), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Nav section label */
.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text3);
    text-transform: uppercase;
    padding: 0 10px;
    margin-bottom: 6px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text2);
    transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--g7), rgba(6,182,212,0.08));
    opacity: 0;
    transition: opacity 0.2s;
}

.nav-link:hover {
    color: var(--g2);
    transform: translateX(4px);
}

.nav-link:hover::before { opacity: 1; }

.nav-link.active {
    background: linear-gradient(135deg, var(--g7), rgba(6,182,212,0.1));
    color: var(--g1);
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(37,160,102,0.12);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(to bottom, var(--g3), var(--cyan));
}

.nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    background: rgba(0,0,0,0.04);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    transform: scale(1.15) rotate(-5deg);
}

.nav-link.active .nav-icon {
    background: linear-gradient(135deg, var(--g6), rgba(6,182,212,0.15));
}

/* Sidebar user card di bawah */
.sidebar-user {
    margin-top: auto;
    padding: 14px;
    background: linear-gradient(135deg, var(--g8), rgba(6,182,212,0.06));
    border-radius: var(--radius-sm);
    border: 1px solid var(--g6);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--g4), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-nim {
    font-size: 11px;
    color: var(--text3);
    font-weight: 500;
}

.sidebar-logout {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text3);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar-logout:hover {
    color: var(--danger);
    background: rgba(255,71,87,0.08);
    transform: scale(1.15);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    animation: fadeInUp 0.4s ease both;
}

/* =============================================
   HERO BANNER
   ============================================= */
.hero-banner {
    background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 40%, var(--g3) 70%, var(--cyan) 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: var(--white);
    padding: 32px 28px 60px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '🌿';
    position: absolute;
    right: 28px; top: 20px;
    font-size: 100px;
    opacity: 0.10;
    animation: float 4s ease-in-out infinite;
}

.hero-text { animation: fadeInLeft 0.5s 0.1s ease both; }

.hero-banner h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.hero-banner p {
    font-size: 14px;
    opacity: 0.82;
    font-weight: 500;
}

.hero-date {
    font-size: 11px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.25);
    animation: fadeInRight 0.5s 0.1s ease both;
}

/* =============================================
   CONTAINER
   ============================================= */
.container {
    max-width: 720px;
    margin: -32px auto 0;
    padding: 0 20px 100px;
    position: relative;
    z-index: 1;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.95);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.3s ease;
    animation: fadeInUp 0.45s ease both;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Colorful top accent strip */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 20px; right: 20px;
    height: 2px;
    background: linear-gradient(90deg, var(--g3), var(--cyan), var(--purple));
    border-radius: 0 0 4px 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover::before { opacity: 1; }

.card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text3);
    margin-bottom: 14px;
    font-weight: 700;
}

.section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text1);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.2px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--g5), transparent);
    border-radius: 2px;
}

/* =============================================
   MOOD TODAY CARD
   ============================================= */
.mood-today-card {
    background: linear-gradient(135deg,
        rgba(255,255,255,0.95) 0%,
        rgba(237,251,243,0.95) 100%);
    border-left: 5px solid transparent;
    border-image: linear-gradient(to bottom, var(--g3), var(--cyan)) 1;
}

.mood-today-display {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

.mood-emoji-big {
    font-size: 52px;
    line-height: 1;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.12));
}

.mood-emoji-md { font-size: 32px; }

.mood-today-display h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.4px;
}

.mood-note {
    font-size: 13px;
    color: var(--text2);
    font-style: italic;
    line-height: 1.55;
}

.mood-empty-card {
    text-align: center;
    padding: 32px;
    border: 2px dashed var(--g5);
    background: linear-gradient(135deg, var(--g7), rgba(6,182,212,0.05));
}

.mood-empty-card p {
    color: var(--text2);
    margin-bottom: 16px;
    font-weight: 600;
}

/* =============================================
   STATS ROW
   ============================================= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 18px 14px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #edfbf3, #d4f5e4); }
.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #f0f4ff, #e0e7ff); }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #fff7ed, #ffedd5); }

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.stat-card:hover .stat-icon {
    transform: scale(1.15) rotate(-8deg);
}

.stat-label {
    font-size: 11px;
    color: var(--text3);
    margin-bottom: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--g2);
    letter-spacing: -0.5px;
    line-height: 1;
}

.stat-value small {
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
}

.stat-link {
    font-size: 13px;
    color: var(--g3);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: gap 0.2s;
}

.stat-link:hover { gap: 6px; }

/* =============================================
   ARTIKEL
   ============================================= */
.article-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 8px 0 6px;
    color: var(--text1);
    line-height: 1.4;
}

.article-card > p {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 12px;
    line-height: 1.65;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: capitalize;
}

.article-tag[data-cat="stres"]     { background:#fff0f7; color:#db2777; border:1px solid #fbcfe8; }
.article-tag[data-cat="tidur"]     { background:#f0f4ff; color:#4f46e5; border:1px solid #c7d2fe; }
.article-tag[data-cat="relaksasi"] { background:#f0fdf4; color:#16a34a; border:1px solid #bbf7d0; }
.article-tag[data-cat="darurat"]   { background:#fff7ed; color:#ea580c; border:1px solid #fed7aa; }

.artikel-full {
    font-size: 13px;
    color: var(--text2);
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
    line-height: 1.7;
}

/* =============================================
   BOT BANNER
   ============================================= */
.bot-banner {
    background: linear-gradient(135deg, var(--g1), var(--g3), var(--cyan));
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    color: white;
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(37,160,102,0.3);
    position: relative;
    overflow: hidden;
}

.bot-banner::after {
    content: '💬';
    position: absolute;
    right: 120px; top: -14px;
    font-size: 90px;
    opacity: 0.07;
    animation: float 5s ease-in-out infinite;
}

.bot-banner h3 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -0.3px;
}

.bot-banner p {
    font-size: 13px;
    opacity: 0.82;
    font-weight: 500;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--g2), var(--g3), var(--cyan));
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    color: var(--white);
    padding: 13px 26px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 4px 18px rgba(37,160,102,0.38);
    font-family: inherit;
    letter-spacing: 0.1px;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 10px 28px rgba(37,160,102,0.48);
}

.btn-primary:active { transform: scale(0.97); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: var(--g2);
    padding: 10px 20px;
    border-radius: 30px;
    border: 2px solid var(--g5);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    font-family: inherit;
}

.btn-outline:hover {
    background: var(--g7);
    border-color: var(--g3);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37,160,102,0.15);
}

.btn-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255,255,255,0.95);
    color: var(--g1);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    font-family: inherit;
}

.btn-white:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}

.btn-sm   { padding: 8px 16px; font-size: 12px; }
.btn-full { width: 100%; display: flex; }

/* =============================================
   ALERTS
   ============================================= */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: popIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: linear-gradient(135deg, #fff5f5, #ffe4e6);
    color: #be123c;
    border: 1px solid #fecdd3;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
    background: linear-gradient(145deg,
        #0d5c35 0%, #1a7a4a 25%,
        #6d28d9 60%, #2563eb 85%, #06b6d4 100%);
    background-size: 300% 300%;
    animation: gradientShift 10s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Floating shapes */
.login-page::before {
    content: '';
    position: fixed;
    top: 10%; left: 10%;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    animation: float 6s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: fixed;
    bottom: 15%; right: 10%;
    width: 160px; height: 160px;
    border-radius: 30px;
    background: rgba(255,255,255,0.05);
    animation: float 8s ease-in-out infinite reverse;
    transform: rotate(45deg);
}

.login-wrap {
    background: rgba(255,255,255,0.93);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 28px;
    padding: 38px 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.95);
    animation: scaleIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.logo-circle {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, var(--g3), var(--cyan));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin: 0 auto 16px;
    box-shadow: 0 10px 30px rgba(37,160,102,0.35);
    animation: float 3s ease-in-out infinite;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--g1), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.login-logo p {
    font-size: 13px;
    color: var(--text2);
    font-weight: 500;
}

.tab-switch {
    display: flex;
    background: #f1f5f9;
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 26px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text3);
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    font-family: inherit;
}

.tab-btn.active {
    background: var(--white);
    color: var(--g1);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transform: scale(1.02);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form.hidden { display: none; }

.login-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text3);
    margin-top: 22px;
    font-weight: 600;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
}

.form-label, label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text1);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text1);
    background: #f8fafc;
    transition: all 0.25s ease;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-weight: 500;
}

input:focus {
    border-color: var(--g3);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(37,160,102,0.1);
    transform: translateY(-1px);
}

.form-select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text1);
    background: #f8fafc;
    outline: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.25s ease;
}

.form-select:focus {
    border-color: var(--g3);
    box-shadow: 0 0 0 4px rgba(37,160,102,0.1);
}

.form-textarea {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text1);
    background: #f8fafc;
    outline: none;
    width: 100%;
    resize: vertical;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.25s ease;
    line-height: 1.6;
}

.form-textarea:focus {
    border-color: var(--g3);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(37,160,102,0.1);
}

/* =============================================
   MOOD PICKER
   ============================================= */
.mood-picker {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.mood-option { flex: 1; cursor: pointer; }
.mood-option input[type="radio"] { display: none; }

.mood-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 4px;
    border-radius: var(--radius-sm);
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    user-select: none;
}

.mood-face:hover {
    border-color: var(--g4);
    background: var(--g7);
    transform: translateY(-5px) scale(1.06);
    box-shadow: 0 10px 24px rgba(37,160,102,0.18);
}

.mood-option input:checked + .mood-face {
    transform: translateY(-6px) scale(1.1);
    box-shadow: 0 12px 28px rgba(37,160,102,0.25);
}

.mood-option:nth-child(1) input:checked + .mood-face { border-color: #ff4757; background: #fff0f0; }
.mood-option:nth-child(2) input:checked + .mood-face { border-color: #ff6b35; background: #fff5f0; }
.mood-option:nth-child(3) input:checked + .mood-face { border-color: #fbbf24; background: #fffbeb; }
.mood-option:nth-child(4) input:checked + .mood-face { border-color: var(--g3); background: var(--g7); }
.mood-option:nth-child(5) input:checked + .mood-face { border-color: var(--g2); background: var(--g7); }

.mood-face-emoji {
    font-size: 28px;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.mood-face:hover .mood-face-emoji,
.mood-option input:checked + .mood-face .mood-face-emoji {
    transform: scale(1.25) rotate(-5deg);
}

.mood-face-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text2);
    text-align: center;
    line-height: 1.2;
}

.mood-1 { color: #ff4757; }
.mood-2 { color: #ff6b35; }
.mood-3 { color: #d97706; }
.mood-4 { color: #16a34a; }
.mood-5 { color: #0d5c35; }

/* =============================================
   SLEEP SLIDER
   ============================================= */
.sleep-slider-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 2px solid #e2e8f0;
    transition: border-color 0.2s;
}

.sleep-slider-wrap:focus-within { border-color: var(--g3); }

.sleep-slider-wrap input[type="range"] {
    flex: 1;
    accent-color: var(--g3);
    cursor: pointer;
    border: none;
    box-shadow: none;
    padding: 0;
}

.sleep-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--g2);
    min-width: 32px;
    text-align: right;
}

.sleep-unit {
    font-size: 13px;
    color: var(--text3);
    font-weight: 700;
}

/* =============================================
   MOOD HISTORY
   ============================================= */
.mood-history { display: flex; flex-direction: column; gap: 10px; }

.mood-history-item {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    animation: fadeInUp 0.4s ease both;
}

.mood-history-item:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.mood-history-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mood-history-label {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 3px;
}

.mood-history-date {
    font-size: 12px;
    color: var(--text3);
    font-weight: 600;
}

.mood-history-activity {
    font-size: 12px;
    color: var(--text2);
    margin-top: 3px;
    font-weight: 600;
}

.mood-history-note {
    background: linear-gradient(135deg, #f8fafc, var(--g8));
    border-left: 3px solid var(--g5);
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text2);
    font-style: italic;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: -4px;
    font-weight: 500;
}

.sleep-badge {
    background: linear-gradient(135deg, var(--g7), rgba(6,182,212,0.08));
    color: var(--g2);
    font-size: 12px;
    padding: 5px 13px;
    border-radius: 20px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid var(--g6);
}

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
    padding: 20px 0 10px;
    margin-bottom: 4px;
    animation: fadeInUp 0.4s ease both;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text1);
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 14px;
    color: var(--text2);
    font-weight: 500;
}

/* =============================================
   BOT CHAT
   ============================================= */
.bot-header {
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 90;
    animation: fadeInUp 0.4s ease both;
}

.bot-avatar {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--g3), var(--cyan));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(37,160,102,0.28);
    animation: pulse 2.5s ease-in-out infinite;
}

.bot-info h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text1);
    letter-spacing: -0.2px;
}

.bot-status {
    font-size: 12px;
    color: var(--g3);
    font-weight: 700;
}

.btn-clear {
    margin-left: auto;
    background: none;
    border: 2px solid #fecdd3;
    color: #be123c;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    font-family: inherit;
    white-space: nowrap;
}

.btn-clear:hover {
    background: #fff5f5;
    border-color: var(--danger);
    transform: scale(1.05);
}

.chat-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 20px 200px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: fadeInUp 0.3s ease both;
}

.user-bubble { flex-direction: row-reverse; animation: fadeInRight 0.3s ease both; }
.bot-bubble  { animation: fadeInLeft 0.3s ease both; }

.bubble-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--g7), rgba(6,182,212,0.12));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.bubble-content {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-radius: 20px 20px 20px 5px;
    padding: 14px 18px;
    max-width: 78%;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.95);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text1);
}

.bubble-content p { margin-bottom: 6px; }
.bubble-content p:last-child { margin-bottom: 0; }

.user-content {
    background: linear-gradient(135deg, var(--g2), var(--g3), var(--cyan));
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
    color: var(--white);
    border-radius: 20px 20px 5px 20px;
    border: none;
    box-shadow: 0 6px 20px rgba(37,160,102,0.35);
}

.bubble-time {
    display: block;
    font-size: 11px;
    opacity: 0.5;
    margin-top: 6px;
    font-weight: 600;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.quick-replies button {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: var(--g2);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    font-family: inherit;
}

.quick-replies button:hover {
    background: var(--g7);
    border-color: var(--g4);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(37,160,102,0.2);
}

/* Typing */
.typing-dots {
    display: flex;
    gap: 5px;
    padding: 4px 2px;
    align-items: center;
}

.typing-dots span {
    width: 9px; height: 9px;
    background: var(--g3);
    border-radius: 50%;
    animation: typingBounce 1.3s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Chat input */
.chat-input-wrap {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 12px 20px 18px;
    z-index: 100;
}

.chat-input-box {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-textarea {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    background: #f8fafc;
    color: var(--text1);
    transition: all 0.25s ease;
}

.chat-textarea:focus {
    border-color: var(--g3);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(37,160,102,0.1);
}

.chat-send-btn {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--g2), var(--cyan));
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 4px 16px rgba(37,160,102,0.45);
}

.chat-send-btn:hover {
    transform: scale(1.12) rotate(20deg);
    box-shadow: 0 10px 24px rgba(37,160,102,0.55);
}

.chat-send-btn:active { transform: scale(0.95); }
.chat-send-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.chat-disclaimer {
    font-size: 11px;
    color: var(--text3);
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================
   EMPTY STATE & MISC
   ============================================= */
.empty-state {
    text-align: center;
    padding: 36px;
    color: var(--text2);
    font-weight: 600;
}

.hidden { display: none !important; }

.footer {
    text-align: center;
    padding: 32px 0 12px;
    font-size: 12px;
    color: var(--text3);
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* =============================================
   BOTTOM NAV — MOBILE ONLY
   ============================================= */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(0,0,0,0.07);
    z-index: 200;
    padding: 8px 0 4px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 20px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text3);
    font-size: 10px;
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}

.bottom-nav-item.active { color: var(--g2); }

.bottom-nav-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    background: transparent;
}

.bottom-nav-item.active .bottom-nav-icon {
    background: linear-gradient(135deg, var(--g7), rgba(6,182,212,0.12));
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 6px 16px rgba(37,160,102,0.2);
}

.bottom-nav-item:not(.active):hover .bottom-nav-icon {
    transform: translateY(-2px) scale(1.05);
    background: #f1f5f9;
}

/* Active dot indicator */
.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--g3), var(--cyan));
}

/* =============================================
   RESPONSIVE — DESKTOP (sidebar visible)
   ============================================= */
@media (min-width: 769px) {
    .sidebar  { display: flex; }
    .bottom-nav { display: none; }

    /* Adjust chat input & bot header for sidebar */
    .bot-header {
        top: 0;
        left: var(--sidebar-w);
    }

    .chat-input-wrap {
        left: var(--sidebar-w);
    }
}

/* =============================================
   RESPONSIVE — MOBILE (bottom nav, no sidebar)
   ============================================= */
@media (max-width: 768px) {
    .sidebar     { display: none; }
    .bottom-nav  { display: flex; }
    .main-content { margin-left: 0; }

    body { padding-bottom: 0; }

    .hero-banner {
        flex-direction: column;
        gap: 12px;
        padding-bottom: 52px;
    }

    .hero-date { align-self: flex-start; }

    .container {
        padding: 0 14px 100px;
        margin-top: -24px;
    }

    .stats-row { grid-template-columns: 1fr 1fr; }
    .stats-row .stat-card:last-child { grid-column: 1 / -1; }

    .mood-picker { gap: 5px; }
    .mood-face { padding: 12px 2px; }
    .mood-face-emoji { font-size: 24px; }
    .mood-face-label { font-size: 9px; }

    .bot-banner {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

    .bubble-content { max-width: 88%; }

    .chat-wrap { padding: 14px 14px 180px; }

    .bot-header {
        top: 0;
        left: 0;
    }

    .chat-input-wrap {
        left: 0;
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }

    body::before, body::after { display: none; }

    .login-wrap { padding: 28px 18px; border-radius: 24px; }
}

/* iPhone notch safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
}