body {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;           /* quan trọng */
    position: relative;

    display: flex;                /* flex layout */
    flex-direction: column;       /* xếp theo cột: header - main - footer */
}

.edu-header {
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;       /* không bị ép nhỏ */
}

/* cho main chiếm hết phần trống còn lại */
main {
    flex: 1 0 auto;       /* quan trọng: main giãn để đẩy footer xuống */
    padding: 24px 0 32px; /* tuỳ bạn, đang dùng để cách header + footer 1 chút */
}

/* Footer chỉ nằm dưới, không cần margin-top lớn nữa */
footer {
    background: rgba(255,255,255,0.1);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 0;        /* bỏ 40px cũ nếu đang có */
    flex-shrink: 0;
}

.floating-icon {
    position: absolute;
    font-size: 50px;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3),
                 -1px -1px 2px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -20px) rotate(5deg);
    }
    50% {
        transform: translate(-15px, 15px) rotate(-5deg);
    }
    75% {
        transform: translate(15px, 10px) rotate(3deg);
    }
}

* {
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 10px;  
    position: relative;
    z-index: 1;
}

/* =========================================================
   HEADER MỚI – 2 TẦNG
   ========================================================= */

.edu-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Tầng 1: banner nền bầu trời */
.edu-hero {
    background: linear-gradient(to bottom, #e6f3ff, #ffffff);
}

.edu-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.edu-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.edu-logo {
    height: 100px;
    width: 100px;
}


.edu-hero-text {
    line-height: 1.25;
}

.edu-hero-line-1 {
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
    color: #333;
}

.edu-hero-line-2 {
    text-transform: uppercase;
    font-size: 30px;
    font-weight: 700;
    color: #d82329; /* đỏ giống header trường */
}

.edu-hero-line-3 {
    font-size: 14px;
    color: #555;
}

/* Nếu có huy chương / logo bên phải */
.edu-hero-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tầng 2: thanh menu xanh */
.edu-main-nav {
    background: #0073cf;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    position: relative;     
}

.edu-main-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 24px;
    display: flex;
    align-items: center;
    justify-content: center;   /* menu ở giữa */
    gap: 16px;
}

.edu-profile-wrapper {
    position: absolute;
    right: 75px;          /* cách mép phải 24px – muốn sát hẳn thì dùng 0 */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;          /* để nổi lên trên */
}
.card .card-meta {
    margin-top: 6px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #4b5563; /* xám đậm */
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#floatingIcons {
    position: fixed;      /* hoặc absolute nếu bạn muốn bám theo page */
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;        /* khóa trong khung màn hình */
    pointer-events: none; /* không cản click vào nội dung */
    overflow: hidden;     /* icon bay ra ngoài không làm tăng height */
    z-index: 0;
  }
  
.card .card-author {
    font-weight: 500;
}

.card .card-time {
    opacity: 0.85;
}

/* Bên trái: user menu */
.edu-nav-left {
    display: flex;
    align-items: center;
}

/* User menu chung */
.user-menu {
    position: relative;
}

/* Nút user:
   - Khi chưa đăng nhập: pill "Đăng nhập"
   - Khi đăng nhập: JS thêm class .logged-in để thành avatar tròn */
.user-menu-button {
    border: none;
    outline: none;
    cursor: pointer;
    padding: 4px 10px;
    
    border-radius: 999px;
    background: #ffffff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    min-width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.user-menu-button:hover {
    background: #f0f4ff;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.35);
    transform: translateY(-1px);
}

/* Dropdown user */
.user-menu-dropdown {
    position: absolute;
    left: 0;
    top: 120%;
    min-width: 180px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
    padding: 6px 0;
    z-index: 999;
}

.user-menu-dropdown.hidden {
    display: none;
}

.user-menu-item {
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.user-menu-item:hover {
    background: #f3f4ff;
}

/* Ở giữa: nhóm nút nav */
.edu-nav-center {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Nút menu – chỉ chữ trắng + gạch dưới khi active */
.nav-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    padding: 20px 0;
    cursor: pointer;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.nav-btn:hover {
    opacity: 0.9;
}

/* Gạch dưới tab đang chọn */
.nav-btn.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 4px;
    width: 100%;
    height: 3px;
    background: #ffffff;
    border-radius: 999px;
}

/* Bên phải: nút tìm kiếm */
.edu-nav-right {
    display: flex;
    align-items: center;
}

.edu-search-btn {
    background: #0057a3;
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.edu-search-btn:hover {
    background: #00457f;
}

/* =========================================================
   CHATBOT BUBBLE
   ========================================================= */

.chatbot-bubble {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

.chatbot-bubble::before {
    content: "💬";
    font-size: 30px;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */

main {
    min-height: calc(100% - 200px);
    padding-top: 16px;   /* trước là 40px */
    padding-bottom: 40px;
    transform: scale(0.90);
    transform-origin: top center;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    color: white;
    font-size: 28px;
    margin-top: 0;       /* rất quan trọng */
    margin-bottom: 15px; 
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 30px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.card-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.card-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    width: 100%;
}

.card-btn:hover {
    background: #5568d3;
}

/* Delete Button */
.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.delete-btn:hover {
    background: #cc0000;
    transform: scale(1.1);
}

/* =========================================================
   DETAIL PAGE
   ========================================================= */

.detail-page {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

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

.detail-title {
    font-size: 28px;
    color: #333;
    font-weight: bold;
}

.back-btn {
    background: #666;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #555;
}

.detail-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.content-iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* =========================================================
   ADMIN FORM
   ========================================================= */

.admin-form {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s;
}

.submit-btn:hover {
    background: #5568d3;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
    background: rgba(255,255,255,0.1);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* =========================================================
   CHATBOT MODAL
   ========================================================= */

.chatbot-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.chatbot-modal.active {
    display: flex;
}

.chatbot-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    height: 80%;
    max-height: 600px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.chatbot-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: all 0.3s;
}

.chatbot-close:hover {
    background: #cc0000;
    transform: rotate(90deg);
}

.chatbot-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 15px;
}

/* =========================================================
   EMPTY / LOADING STATE
   ========================================================= */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-state-subtext {
    font-size: 14px;
    opacity: 0.8;
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 18px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .edu-hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .edu-main-nav-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .edu-nav-center {
        flex-wrap: wrap;
        justify-content: center;
    }

    .edu-nav-right {
        align-self: flex-end;
    }

    .page-title {
        font-size: 24px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .chatbot-bubble {
        width: 50px;
        height: 50px;
        top: 15px;
        right: 15px;
    }

    .chatbot-bubble::before {
        font-size: 24px;
    }

    .content-iframe {
        height: 400px;
    }
}
.user-menu-button {
    background: transparent !important;   /* bỏ nền trắng */
    box-shadow: none !important;          /* bỏ bóng trắng */
    padding: 4px 8px !important;          /* gọn hơn nếu cần */
}

/* Nút user – luôn là pill, bên trong chứa avatar + tên */
.user-menu-button {
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 999px;
    background: transparent;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    min-width: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: none;  
    transition: background 0.2s, transform 0.1s, box-shadow 0.1s;
  }
  
  .user-menu-button:hover {
    background: #f0f4ff;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.35);
    transform: translateY(-1px);
  }
  
  /* Avatar tròn chứa chữ cái đầu */
  .user-avatar-circle {
    width: 42px;
    height: 42px;
    font-size: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    display: none;           /* guest: ẩn avatar */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  /* Khi đã đăng nhập mới hiển thị avatar */
  .user-menu-button.logged-in .user-avatar-circle {
    display: flex;
  }
  
  /* Label bên phải avatar */
  .user-menu-label {
    font-size: 14px;
    color: #222;
  }
  
  /* Logged-in chỉ khác màu chữ 1 chút (nếu muốn) */
  .user-menu-button.logged-in {
    background: #ffffff;
    color: #222;
  }
  