/* ================== ROOT & RESET ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000000;     
    --secondary-color: #e6982b;  
    --accent-color: #FBF5D2;      
    --btn-color: #f9e106;         
    --btn-hover: #ffcc00;        
    --btn-text: #333333;          
    --heading-color: #333333;     
    --text-color: #333333;     
    --light-bg: #F5F5F5;          
    --white: #FFFFFF;           
    --shadow: 0 8px 24px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================== NAVIGATION BAR ================== */
.navbar {
    background: linear-gradient(135deg, #f78a1d, #ffea96);
    color: var(--text-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    font-family: "Playwrite GB J", cursive;
    font-optical-sizing: auto;
    font-style: normal;
}

.logo:hover {
    transform: scale(1.05);
}

.navbar .logo .logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex: 1;
    justify-content: center;
    position: relative;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: block;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: var(--btn-color);
    color: var(--btn-text);
}

/* ================== DROPDOWN MENU ================== */
.dropdown {
    display: none;
    position: absolute;
    top: 35px;
    left: 0;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    min-width: 180px;
    width: max-content;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    overflow: hidden;
    z-index: 1000;
    list-style: none;
}

/* Cầu nối tàng hình - Giữ menu hiển thị khi rê từ li sang dropdown */
.dropdown::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

/* Hiển thị menu khi rê chuột */
.nav-links > li:hover > .dropdown,
.dropdown:hover {
    display: block;
}

/* Định dạng các mục trong dropdown */
.dropdown > li {
    display: block;
    list-style: none;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown > li:last-child {
    border-bottom: none;
}

/* Định dạng link trong dropdown */
.dropdown > li > a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 20px;
    color: #333333 !important;
    text-decoration: none;
    background-color: #ffffff;
    transition: var(--transition);
}

/* Hiệu ứng hover cho từng dòng trong dropdown */
.dropdown > li > a:hover {
    background-color: var(--btn-color);
    color: var(--btn-text) !important;
    padding-left: 25px;
}

/* ===== THANH TÌM KIẾM TRONG NAVBAR ===== */
.navbar-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.15);
    margin-right: 1rem;
}

.navbar-search input {
    width: 160px;
    padding: 6px 14px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    outline: none;
    color: var(--text-color);
}

.navbar-search button {
    padding: 6px 12px;
    background: var(--btn-color);
    border: none;
    cursor: pointer;
    color: var(--btn-text);
    font-size: 0.85rem;
    transition: var(--transition);
}

.navbar-search button:hover {
    background: var(--btn-hover);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-login {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
}

.btn-login:hover {
    background-color: var(--text-color);
    color: var(--white);
}

.btn-register, .btn-primary {
    background-color: var(--btn-color);
    color: var(--btn-text);
}

.btn-register:hover, .btn-primary:hover {
    background-color: var(--btn-hover);
    transform: scale(1.05);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--text-color);
}

/* ================== HERO SECTION ================== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 500px;
    padding: 6rem 0;
    background-color: var(--primary-color);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(139, 69, 19, 0.55),
        rgba(139, 69, 19, 0.55)
    );
    z-index: 1;
}

/* Kéo dãn ảnh tràn màn hình - Tên class phải khớp HTML */
.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45; /* Làm mờ ảnh để chữ dễ đọc */
    z-index: 1;
}

/* Đưa phần chữ nổi lên trên */
.hero .container {
    position: relative;
    z-index: 2;
    width: 100%;
    display: block; 
}

/* Căn trái và giới hạn độ rộng của chữ */
.hero-content {
    max-width: 650px; 
    text-align: left; 
    margin-left: 0; 
    margin-right: auto;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    animation: slideInLeft 0.8s ease-out;
    font-family: "Playwrite GB J", cursive;
    font-optical-sizing: auto;
    font-style: normal;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--white);
    line-height: 1.5;
    animation: slideInLeft 0.8s ease-out 0.2s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    animation: slideInLeft 0.8s ease-out 0.4s backwards;
}
/* ================== DOCUMENTS SECTION ================== */
.documents {
    padding: 5rem 0;
    background-color: var(--light-bg);
}

.documents h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--heading-color);
}

/* ===== THANH TÌM KIẾM TÀI LIỆU ===== */
.document-search {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 30px;
    overflow: hidden;
    border: 2px solid var(--btn-color);
    margin: -1rem auto 3rem auto; /* Căn giữa và điều chỉnh khoảng cách trên dưới */
    max-width: 600px;
    box-shadow: var(--shadow);
}

.document-search input {
    flex: 1;
    padding: 12px 25px;
    border: none;
    background: transparent;
    font-size: 1.05rem;
    outline: none;
    color: var(--text-color);
}

.document-search button {
    padding: 12px 30px;
    background: var(--btn-color);
    border: none;
    cursor: pointer;
    color: var(--btn-text);
    font-size: 1.05rem;
    font-weight: 600;
    transition: var(--transition);
}

.document-search button:hover {
    background: var(--btn-hover);
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--btn-color);
    background: white;
    color: var(--text-color);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--btn-color);
    color: var(--btn-text);
}

/* Bố cục chia cột Sidebar & Grid */
.documents-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.sidebar-col {
    flex: 0 0 300px;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 18px;
    border: 1px solid #EEE4D2;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    max-height: 80vh;
    overflow-y: auto;
}

.title-star-ms h3 {
    color: var(--heading-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.card-body {
    margin-top: 0;
}

.mod-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
}

.mod-list li {
    margin-bottom: 0;
    border-bottom: 1px solid #ccc;
    position: relative;
}

.mod-list > li:last-child {
    border-bottom: none;
}

.mod-list a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    display: block;
    padding: 12px 20px;
}

.mod-list a:hover {
    background-color: #F0F0F0;
    color: var(--secondary-color);
    padding-left: 25px;
}

/* Submenu trong sidebar */
.mod-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mod-list > li:hover > ul {
    max-height: 500px;
}

.mod-list ul li {
    border-bottom: 1px solid #f0f0f0;
}

.mod-list ul a {
    font-weight: 400;
    font-size: 0.95rem;
    padding-left: 40px;
    background-color: #fdfdfd;
}

.mod-list ul a:hover {
    background-color: #F0F0F0;
}

.documents-main {
    flex: 1;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.document-card {
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,.08);
    transition: var(--transition);
    border: none;
}

.document-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
    border: none;
}

.document-thumbnail {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.document-content {
    padding: 1.5rem;
}

.document-category {
    background-color: var(--btn-color);
    color: var(--btn-text);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.document-card h3 {
    color: var(--heading-color);
    margin: 1rem 0;
    font-size: 1.2rem;
}

.document-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.document-meta {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: #888;
}

.btn-small {
    padding: 0.7rem 1rem;
    background-color: var(--btn-color);
    color: var(--btn-text);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    font-weight: 700;
    transition: var(--transition);
    display: block;
    text-align: center;
    text-decoration: none;
    margin-top: 1rem;
}

.btn-small:hover {
    background-color: var(--btn-hover);
}

.load-more-container {
    text-align: center;
    margin-top: 3rem;
}

.document-card.hidden {
    display: none;
}

/* ===== TRANG TÌM KIẾM ===== */
.search-highlight {
    background: #ffd13c;
    border-radius: 3px;
    padding: 0 2px;
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #888;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 4rem;
    color: #ccc;
    display: block;
    margin-bottom: 1rem;
}

/* ================== FEATURES SECTION ================== */
.features {
    padding: 5rem 0;
    background-color: var(--white);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--heading-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--heading-color);
    margin-bottom: 1rem;
}

/* ================== ABOUT SECTION ================== */
.about {
    padding: 10px;
    background-color: white;
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    margin-left: 0;
}

.about h2 {
    font-size: 2.5rem;
    color: var(--heading-color);
    margin-bottom: 1.5rem;
    text-align: left;
}

.about p {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.8;
    margin-bottom: 2rem;
    text-align: justify;
}

.about-list {
    list-style: none;
    margin-top: 0.5rem;
    list-style-type: disc;
}

.about-list li {
    padding: 0.7rem 0;
    font-size: 1.05rem;
    color: #555;
}

/* ================== EXPLORE MORE ================== */
.explore-more {
    background-color: #F5F5F5;
    padding: 4rem 0;
}

.explore-box {
    background-color: var(--white);
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.explore-box h3 {
    font-size: 1.2rem;
    color: var(--heading-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.explore-list {
    list-style: none;
}

.explore-list li {
    border-top: 1px solid #F0F0F0;
}

.explore-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    color: #555;
    text-decoration: none;
    font-size: 1.05rem;
    transition: var(--transition);
}

.explore-list a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.explore-list .arrow {
    font-size: 1.5rem;
    color: #999;
}

/* ================== FOOTER ================== */
.footer {
    background: linear-gradient(135deg, #f78a1d, #ffea96);
    color: var(--text-color);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    padding: 0 1rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section p {
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 0.3rem 0;
}

.footer-section a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.contact-item {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.contact-icon {
    font-size: 1.3rem;
    color: var(--accent-color);
    min-width: 20px;
}

.contact-text {
    display: flex;
    flex-direction: column;
}

.contact-text strong {
    font-size: 0.9rem;
    display: block;
    margin-bottom: 3px;
}

.contact-text a {
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
}

.contact-text a:hover {
    color: var(--accent-color);
}

/* ================== SCROLL TOP BUTTON ================== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ================== ANIMATIONS ================== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.user-greeting {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 20px;
}

.btn-logout {
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--text-color);
    color: white;
}