/* ==========================================================
   GÓC CHỮA LÀNH HỌC ĐƯỜNG & SỔ CHỮA LÀNH
   Thiết kế giao diện hiện đại, êm dịu, chuẩn đề tài KHKT
   Màu chủ đạo: Sage Green, Soft Sky, Pastel Rose, Ivory Cream
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Quicksand:wght@500;600;700&display=swap');

:root {
    /* Palette màu êm dịu theo yeucau.txt */
    --primary: #2d7a58;
    --primary-light: #48bb78;
    --primary-soft: #ebfbee;
    --primary-dark: #1b4d36;
    
    --sky: #0284c7;
    --sky-soft: #f0f9ff;
    
    --rose: #e11d48;
    --rose-soft: #fff1f2;
    --pink-pastel: #fce7f3;
    
    --amber: #d97706;
    --amber-soft: #fef3c7;
    
    --purple: #7c3aed;
    --purple-soft: #f5f3ff;
    
    /* Backgrounds */
    --bg-main: #fbfaf8;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: #ffffff;
    --border-color: rgba(45, 122, 88, 0.12);
    --border-subtle: #e5e7eb;
    
    /* Text */
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(45, 122, 88, 0.08);
    --shadow-lg: 0 10px 30px rgba(45, 122, 88, 0.12);
    --shadow-hover: 0 14px 34px rgba(45, 122, 88, 0.16);
    
    /* Border Radii */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* Transition */
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    background-image: 
        radial-gradient(at 10% 15%, rgba(235, 251, 238, 0.8) 0px, transparent 50%),
        radial-gradient(at 90% 85%, rgba(240, 249, 255, 0.8) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(253, 242, 248, 0.5) 0px, transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Quicksand', 'Nunito', sans-serif;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.3;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 860px;
}

/* ==========================================================
   NAVBAR & HEADER
   ========================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 74px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary-dark);
    flex-shrink: 0;
    white-space: nowrap;
}
.brand-logo .logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #34d399, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
    flex-shrink: 0;
}
.brand-logo .brand-text {
    display: flex;
    flex-direction: column;
}
.brand-logo .brand-text span {
    line-height: 1.2;
}
.brand-logo .brand-text small {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 1;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    transition: var(--transition);
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    background-color: var(--primary-soft);
    color: var(--primary-dark);
}
.nav-link i {
    font-size: 0.95rem;
    color: var(--primary);
}
.nav-caret {
    font-size: 0.72rem;
    opacity: 0.7;
    margin-left: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Account Dropdown */
.account-dropdown-wrap {
    position: relative;
    flex-shrink: 0;
}
.account-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    background: var(--primary-soft);
    border: 1px solid rgba(45, 122, 88, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    transition: var(--transition);
    max-width: 190px;
}
.account-dropdown-btn:hover {
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}
.account-user-name {
    display: inline-block;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    vertical-align: middle;
}
.user-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.account-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 270px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
    border: 1px solid var(--border-color);
    padding: 0;
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
    overflow: hidden;
}

/* Wide layout cho Admin & Giám sát: 2 cột gọn gàng */
.account-menu.account-menu-wide {
    width: 440px;
}

/* Thân menu cuộn được mượt mà nếu quá dài */
.account-menu-body {
    max-height: calc(82vh - 120px);
    overflow-y: auto;
    padding: 10px 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.account-menu-body::-webkit-scrollbar {
    width: 6px;
}
.account-menu-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
}

/* Grid 2 cột */
.account-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
}

.account-section-title {
    padding: 6px 8px 4px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.account-section-title i {
    font-size: 0.75rem;
}

.account-menu-footer {
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.account-menu-footer .logout-link {
    color: #be123c !important;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.account-dropdown-wrap:hover .account-menu,
.account-dropdown-wrap.open .account-menu {
    display: block;
}

/* Nav dropdown styles */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    border: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

.nav-dropdown-menu a:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}
.account-menu-header {
    padding: 12px 16px 10px;
    background: #fbfdfc;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.account-menu-header strong {
    display: block;
    font-size: 0.98rem;
    color: var(--primary-dark);
}
.account-menu a, .account-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.18s, transform 0.15s;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
}
.account-menu a i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.account-menu a:hover, .account-menu button:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
    transform: translateX(2px);
}
.account-menu-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 0;
}

/* Tabs & Mood Star Rating */
.tabs-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    background: #ffffff;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.tab-link:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}
.tab-link.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(45, 122, 88, 0.25);
}

.mood-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-top: 6px;
}
.mood-star-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    transition: var(--transition);
    user-select: none;
}
.mood-star-item input[type="radio"] {
    display: none;
}
.mood-star-item .mood-emoji {
    font-size: 1.7rem;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mood-star-item .mood-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
}
.mood-star-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}
.mood-star-item:hover .mood-emoji {
    transform: scale(1.22);
}
.mood-star-item.active,
.mood-star-item:has(input[type="radio"]:checked) {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.mood-star-item.active .mood-label,
.mood-star-item:has(input[type="radio"]:checked) .mood-label {
    color: var(--primary-dark);
}

.letter-compose-box {
    display: none;
    background: #ffffff;
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease-out;
}
.letter-compose-box.show {
    display: block;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-dark);
    cursor: pointer;
}

/* ==========================================================
   BUTTONS & BADGES
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-family: 'Quicksand', 'Nunito', sans-serif;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-align: center;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(45, 122, 88, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(45, 122, 88, 0.35);
}

.btn-secondary {
    background: #ffffff;
    color: var(--primary-dark);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background: var(--primary-soft);
    border-color: var(--primary-light);
}

.btn-rose {
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    color: #ffffff;
}
.btn-rose:hover {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #ffffff;
}

.btn-sky {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}
.btn-lg {
    padding: 14px 30px;
    font-size: 1.08rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-rose { background: #ffe4e6; color: #be123c; }
.badge-indigo { background: #e0e7ff; color: #4338ca; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }

/* ==========================================================
   CARDS & SECTIONS
   ========================================================== */
.section {
    padding: 60px 0;
}
.section-sm {
    padding: 35px 0;
}
.section-title-wrap {
    text-align: center;
    margin-bottom: 45px;
}
.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
    border: 1px solid rgba(45, 122, 88, 0.15);
}
.section-title {
    font-size: 2.2rem;
    margin-bottom: 12px;
}
.section-desc {
    max-width: 680px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 28px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}
.card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(45, 122, 88, 0.25);
}

/* Hero Section */
.hero-banner {
    position: relative;
    padding: 60px 0 70px;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
}
.hero-content h1 {
    font-size: 2.7rem;
    line-height: 1.25;
    margin-bottom: 18px;
}
.hero-content .highlight {
    background: linear-gradient(120deg, #10b981, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-quote {
    font-size: 1.15rem;
    color: #4b5563;
    padding-left: 18px;
    border-left: 4px solid var(--primary-light);
    margin: 20px 0 28px;
    font-style: italic;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-visual {
    position: relative;
}
.hero-card-floating {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}
.hero-stat-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    margin-top: 14px;
}
.hero-stat-badge .stat-icon {
    font-size: 1.8rem;
    color: var(--primary);
}

/* ==========================================================
   MOOD SELECTOR (SỔ CHỮA LÀNH)
   ========================================================== */
.mood-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin: 20px 0;
}
.mood-card-item {
    position: relative;
    cursor: pointer;
}
.mood-card-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.mood-card-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 10px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.mood-card-box .mood-emoji {
    font-size: 2.2rem;
    margin-bottom: 8px;
    transition: transform 0.25s ease;
}
.mood-card-box .mood-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main);
}
.mood-card-item:hover .mood-card-box {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}
.mood-card-item:hover .mood-emoji {
    transform: scale(1.15);
}
.mood-card-item input[type="radio"]:checked + .mood-card-box {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 4px 14px rgba(45, 122, 88, 0.2);
    transform: translateY(-4px);
}
.mood-card-item input[type="radio"]:checked + .mood-card-box .mood-title {
    color: var(--primary-dark);
}

/* ==========================================================
   STICKY WALL (BẢNG LỜI NHẮN TÍCH CỰC)
   ========================================================== */
.sticky-wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 10px 0;
}
.sticky-note {
    position: relative;
    padding: 24px 22px 18px;
    border-radius: 8px 8px 16px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}
.sticky-note::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px dashed rgba(0,0,0,0.15);
    border-radius: 2px;
}
.sticky-note:hover {
    transform: translateY(-6px) rotate(0deg) !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
    z-index: 5;
}

.sticky-green { background: #eafaf1; border-top: 4px solid #34d399; }
.sticky-blue  { background: #e8f4fd; border-top: 4px solid #60a5fa; }
.sticky-pink  { background: #fdf2f8; border-top: 4px solid #f472b6; }
.sticky-yellow{ background: #fef9c3; border-top: 4px solid #facc15; }
.sticky-purple{ background: #f5f3ff; border-top: 4px solid #a78bfa; }

.sticky-to {
    font-size: 0.86rem;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sticky-content {
    font-size: 0.98rem;
    color: #1f2937;
    margin-bottom: 16px;
    font-style: italic;
    line-height: 1.5;
}
.sticky-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #6b7280;
    border-top: 1px dashed rgba(0,0,0,0.1);
    padding-top: 10px;
}
.sticky-reactions {
    display: flex;
    gap: 10px;
}
.reaction-btn {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.reaction-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
}

/* ==========================================================
   CÂY ĐIỀU ƯỚC (WISH TREE)
   ========================================================== */
.wish-tree-container {
    position: relative;
    background: linear-gradient(180deg, #ecfeff 0%, #f0fdf4 100%);
    border-radius: var(--radius-lg);
    border: 2px solid #bbf7d0;
    min-height: 480px;
    padding: 30px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.03);
}
.wish-tree-bg {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    opacity: 0.28;
    pointer-events: none;
}
.wishes-board {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    position: relative;
    z-index: 2;
}
.wish-leaf {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #bbf7d0;
    border-radius: 30px 4px 30px 4px;
    padding: 12px 18px;
    max-width: 260px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    animation: gentle-sway 4s ease-in-out infinite alternate;
    cursor: pointer;
    transition: var(--transition);
}
.wish-leaf:hover {
    transform: scale(1.06) !important;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}
.wish-leaf.gold { border-color: #fde047; background: #fefce8; }
.wish-leaf.pink { border-color: #f9a8d4; background: #fdf2f8; }
.wish-leaf.cyan { border-color: #67e8f9; background: #ecfeff; }

/* ==========================================================
   MINDFUL BREATHING & RELAXATION
   ========================================================== */
.breathing-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.breathing-circle-outer {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
}
.breathing-orb {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, #6ee7b7, #10b981);
    box-shadow: 0 0 35px rgba(52, 211, 153, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 4s ease-in-out;
}
.breathing-circle-outer::after {
    content: '';
    position: absolute;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    border: 2px dashed rgba(52, 211, 153, 0.4);
    animation: spin 30s linear infinite;
}

/* ==========================================================
   AUDIO SYNTHESIZER / FLOATING PLAYER
   ========================================================== */
.floating-audio-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
}
.audio-toggle-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.audio-toggle-btn:hover {
    transform: scale(1.08);
}
.audio-panel {
    display: none;
    position: absolute;
    bottom: 66px;
    right: 0;
    width: 310px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    padding: 20px;
}
.audio-panel.open {
    display: block;
    animation: slideUp 0.25s ease-out;
}

/* ==========================================================
   FORMS & INPUTS
   ========================================================== */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    font-weight: 700;
    font-size: 0.94rem;
    margin-bottom: 7px;
    color: var(--primary-dark);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.96rem;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-main);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 122, 88, 0.12);
}
textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

/* Checklist Items */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}
.checklist-item:hover {
    background: var(--primary-soft);
    border-color: var(--primary-light);
}
.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}
.checklist-item.checked {
    background: var(--primary-soft);
    border-color: var(--primary-light);
    text-decoration: line-through;
    color: var(--text-muted);
}

/* ==========================================================
   ALERTS & TOASTS
   ========================================================== */
.alert-toast {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    font-size: 0.95rem;
    font-weight: 600;
    max-width: 420px;
    animation: slideDown 0.3s ease-out;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.alert-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.alert-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    margin-left: auto;
}
.alert-close:hover { opacity: 1; }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
    margin-top: auto;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 50px 0 25px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand h4 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}
.footer-brand p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}
.footer-title {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin-bottom: 18px;
    font-weight: 700;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 9px;
}
.footer-links a {
    color: var(--text-muted);
    font-size: 0.92rem;
}
.footer-links a:hover {
    color: var(--primary);
    padding-left: 4px;
}
.hotline-card {
    background: var(--rose-soft);
    border: 1px solid #fecdd3;
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 0.88rem;
}
.hotline-num {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--rose);
}
.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================
   ANIMATIONS
   ========================================================== */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes gentle-sway {
    0% { transform: rotate(-2deg); }
    100% { transform: rotate(2deg); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */
@media (max-width: 1200px) {
    .nav-links {
        gap: 4px;
    }
    .nav-link {
        padding: 7px 10px;
        font-size: 0.88rem;
    }
    .brand-logo .brand-text small {
        display: none;
    }
    .account-user-name {
        max-width: 85px;
    }
}
@media (max-width: 992px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 74px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        gap: 6px;
        align-items: stretch;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 14px;
        border-radius: var(--radius-md);
    }
    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: 1px solid var(--border-subtle);
        background: var(--bg-cream);
        border-radius: var(--radius-md);
        margin: 4px 0 6px 12px;
        min-width: unset;
    }
    .nav-dropdown-menu a {
        padding: 8px 14px;
        font-size: 0.88rem;
    }
    .mobile-toggle {
        display: block;
    }
    .hero-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .account-menu.account-menu-wide {
        width: 330px;
        right: -8px;
    }
    .account-menu-body {
        max-height: 70vh;
    }
    .hero-content h1 {
        font-size: 2.1rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
}
@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    .brand-logo {
        gap: 8px;
    }
    .brand-logo .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .brand-logo .brand-text span {
        font-size: 1.1rem;
    }
    .account-user-name {
        display: none;
    }
    .account-dropdown-btn {
        padding: 4px 8px 4px 4px;
        gap: 6px;
    }
    .account-menu,
    .account-menu.account-menu-wide {
        position: fixed;
        top: 66px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: calc(100vw - 24px);
    }
    .account-menu-body {
        max-height: calc(85vh - 120px);
    }
    .account-grid-2col {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* ==========================================================
   ROLE BADGES (Theo chitietyeucau.txt: Người dùng - Xanh lá, GSV - Vàng, Admin - Đỏ)
   ========================================================== */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.role-user {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.role-gsv {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}
.role-admin {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

/* Slogan Ticker / Rotating Banner */
.slogan-ticker-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(45, 122, 88, 0.2);
    border-radius: 9999px;
    padding: 8px 20px;
    box-shadow: 0 4px 15px rgba(45, 122, 88, 0.08);
    margin-bottom: 20px;
}
.slogan-ticker-tag {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 9999px;
}
.slogan-ticker-text {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1e3a2b;
    min-width: 280px;
    display: inline-block;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Rich Text Content */
.rich-text-content {
    line-height: 1.75;
    color: #374151;
    font-size: 1rem;
}
.rich-text-content p {
    margin-bottom: 12px;
}
.rich-text-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 12px 0;
}

/* ==========================================================
   SITE FOOTER (STICKY FOOTER & RESPONSIVE REPOSITION)
   ========================================================== */
main {
    flex: 1 0 auto;
    width: 100%;
}

.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    background: #ffffff;
    border-top: 1px solid rgba(45, 122, 88, 0.12);
    padding: 50px 0 25px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.02);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 36px;
    align-items: start;
}

.footer-brand p {
    margin-top: 10px;
}

.footer-title {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
    font-weight: 700;
    position: relative;
    padding-bottom: 8px;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary-light);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a {
    color: #4b5563;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.footer-links a i {
    font-size: 0.75rem;
    color: var(--primary-light);
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--primary);
    transform: translateX(4px);
}
.footer-links a:hover i {
    color: var(--primary);
}

.hotline-card {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.06);
}
.hotline-num {
    font-size: 1.15rem;
    font-weight: 800;
    color: #be123c;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-bottom {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.6;
}

/* --- Responsive Footer: iPad & Tablet (<= 992px) --- */
@media (max-width: 992px) {
    .site-footer {
        padding: 40px 0 20px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px 24px;
    }
    .footer-brand {
        grid-column: 1 / -1;
        max-width: 680px;
    }
    .footer-brand p {
        font-size: 0.95rem;
    }
    .footer-links-col {
        grid-column: 1 / 2;
    }
    .footer-hotline-col {
        grid-column: 2 / 3;
    }
}

/* --- Responsive Footer: Điện thoại & Mobile (<= 768px & <= 576px) --- */
@media (max-width: 768px) {
    .site-footer {
        padding: 32px 0 18px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-brand {
        grid-column: auto;
    }
    .footer-links-col {
        grid-column: auto;
    }
    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 16px;
    }
    .footer-links li a {
        padding: 5px 0;
        font-size: 0.9rem;
    }
    .footer-hotline-col {
        grid-column: auto;
    }
    .hotline-card {
        padding: 14px;
    }
    .footer-bottom {
        margin-top: 24px;
        padding-top: 16px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .footer-links {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .hotline-num {
        font-size: 1.05rem;
    }
    .footer-brand .brand-logo {
        flex-direction: row;
        align-items: center;
    }
}

/* ==========================================================
   RESPONSIVE & REPOSITION: TIN TỨC, KHẢO SÁT & QUẢN LÝ
   ========================================================== */

/* Layout 2 cột Trang Tin Tức & Khảo sát */
.news-layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

.news-sidebar-card, .news-survey-box {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 90px;
}

/* Bài viết Rich text responsive */
.rich-text-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
}

.rich-text-content table {
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* Responsive Table container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Breakpoint Tablet & Màn hình vừa (<= 992px) */
@media (max-width: 992px) {
    .news-layout-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .news-sidebar-card, .news-survey-box {
        position: static;
        top: auto;
    }

    .stats-mood-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Breakpoint Mobile (<= 768px) */
@media (max-width: 768px) {
    .news-form-grid,
    .survey-options-grid,
    .account-security-grid {
        grid-template-columns: 1fr !important;
    }

    .form-group-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Breakpoint Mobile nhỏ (<= 576px) */
@media (max-width: 576px) {
    .news-survey-box {
        padding: 18px 14px;
    }
}

/* ==========================================================
   MODERN TOGGLE SWITCH & SECURITY LOCK COMPONENT
   ========================================================== */
.switch-control-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.switch-toggle-label {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}
.switch-toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.switch-toggle-label input:checked + .switch-slider {
    background: linear-gradient(135deg, #10b981, #059669);
}
.switch-toggle-label input:checked + .switch-slider:before {
    transform: translateX(24px);
}

/* Modal Popup xác thực */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    animation: fadeIn 0.2s ease-out;
}
.modal-box {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    max-width: 440px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.25s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================
   PAGINATION & MODERN SEARCH BAR COMPONENTS
   ========================================================== */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 30px 0 10px;
    flex-wrap: wrap;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 38px;
    height: 38px;
    padding: 6px 14px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.pagination-link:hover {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}
.pagination-link.active {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.pagination-link.disabled {
    opacity: 0.45;
    pointer-events: none;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

/* Thanh tìm kiếm & lọc bộ lọc hiện đại, tinh tế */
.search-filter-card {
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid rgba(16, 185, 129, 0.16);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 22px;
    transition: all 0.25s ease;
}
.search-filter-card:focus-within {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.08);
}
.search-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}
.search-filter-item {
    flex: 1 1 180px;
}
.search-filter-item.search-filter-grow {
    flex: 2 1 240px;
}
.search-filter-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}
.search-filter-item label i {
    color: #10b981;
}
.search-filter-item input,
.search-filter-item select {
    width: 100%;
    border-radius: 11px;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.91rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: #f8fafc;
    color: #1e293b;
}
.search-filter-item input:hover,
.search-filter-item select:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}
.search-filter-item input:focus,
.search-filter-item select:focus {
    border-color: #10b981;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}
.search-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.search-filter-actions .btn {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Accordion Collapsible Search Drawer cho quản trị */
.search-drawer {
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 14px;
    background: #ffffff;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.25s ease;
}
.search-drawer summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.92rem;
    color: #065f46;
    background: #f0fdf4;
    user-select: none;
    transition: background 0.2s;
}
.search-drawer summary::-webkit-details-marker {
    display: none;
}
.search-drawer summary:hover {
    background: #dcfce7;
}
.search-drawer[open] summary {
    border-bottom: 1px solid #e2e8f0;
}
.search-drawer .search-drawer-body {
    padding: 18px;
    background: #ffffff;
}
.search-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
}
