/* Reset CSS cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #121212;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    /* Thêm padding-top để tránh bị navbar che */
    padding-top: 80px;
}

/* Sticky Navbar - Fixed positioning */
nav {
    position: fixed;
    /* Đổi từ sticky thành fixed */
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    /* Tăng opacity để rõ hơn */
    backdrop-filter: blur(15px);
    /* Thêm blur effect */
    z-index: 1000;
    /* Tăng z-index để đảm bảo luôn ở trên cùng */
    padding: 15px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    /* Thêm shadow */
}

nav.light-mode {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    margin-right: 30px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.logo:hover {
    color: #ffd700;
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links li a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    padding: 10px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.nav-links li a .icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.nav-links li a:hover {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    z-index: 1001;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    will-change: transform, opacity;
    pointer-events: none;
}

.dropdown-menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 10px;
}

.dropdown-menu a:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    transform: translateX(5px);
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    /* Bật lại pointer events khi hiển thị */
}

.dropdown:hover .dropdown-menu {
    animation: fadeInDropdown 0.3s ease forwards;
}

/* Thêm delay để tránh dropdown biến mất quá nhanh */
.dropdown:hover .dropdown-menu {
    animation: fadeInDropdown 0.3s ease forwards;
}

@keyframes fadeInDropdown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Đảm bảo dropdown không bị che bởi các element khác */
.nav-links li.dropdown {
    position: relative;
    z-index: 1002;
}

/* Thêm hover area để dropdown không biến mất khi di chuyển chuột */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
    z-index: 1000;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
}

.search-bar input {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    outline: none;
    font-size: 0.95rem;
    width: 200px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-bar input:focus {
    width: 250px;
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Login Button */
.login-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #ff6f61, #ffd700);
    border: none;
    border-radius: 25px;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 111, 97, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 111, 97, 0.4);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 250px;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    padding: 20px;
    transition: left 0.5s ease;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu ul {
    list-style: none;
    margin-top: 50px;
}

.mobile-menu ul li {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
}

/* Hamburger */
.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #fff;
    margin-right: 15px;
    z-index: 201;
    /* Đảm bảo hamburger ở trên cùng */
}

/* Hiệu ứng glass morphism cho các thành phần */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Header chính của trang thư viện */
.library-header {
    position: relative;
    padding: 100px 20px 80px;
    /* Tăng padding-top để tránh bị navbar che */
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    margin-top: 0;
    /* Đảm bảo không có margin */
}

/* Hiệu ứng particles nền cho header */
.library-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.3)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.2)"/><circle cx="40" cy="80" r="1.5" fill="rgba(255,255,255,0.25)"/></svg>');
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
    }
}

.library-header h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
    z-index: 1;
    position: relative;
    font-weight: 700;
}

.library-header p {
    font-size: 1.3rem;
    opacity: 0.9;
    z-index: 1;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Container chính cho nội dung thư viện */
.library-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Thanh điều khiển và bộ lọc */
.library-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Phần bộ lọc danh mục */
.filter-tabs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.filter-tab:hover {
    background: rgba(255, 111, 97, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 111, 97, 0.3);
}

.filter-tab.active {
    background: #ff6f61;
    border-color: #ff6f61;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 111, 97, 0.4);
}

/* Phần sắp xếp và tìm kiếm */
.sort-search {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    outline: none;
    font-size: 1rem;
    width: 220px;
    transition: all 0.3s ease;
}

.search-box:focus {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.sort-select {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.sort-select:hover,
.sort-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffd700;
}

.sort-select option {
    background: #121212;
    color: #fff;
}

/* Lưới hiển thị các tác phẩm nghệ thuật */
.artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Card hiển thị từng tác phẩm */
.artwork-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
}

.artwork-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.3);
}

/* Hình ảnh tác phẩm */
.artwork-image {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

/* Overlay thông tin xuất hiện khi hover */
.artwork-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
    transform: scale(1.1);
}

.artwork-card:hover .artwork-overlay {
    opacity: 1;
    transform: scale(1);
}

.overlay-content {
    text-align: center;
    color: #fff;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.artwork-card:hover .overlay-content {
    transform: translateY(0);
}

.overlay-content h4 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.overlay-content p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Thông tin chi tiết tác phẩm */
.artwork-info {
    padding: 25px;
}

.artwork-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 600;
    line-height: 1.3;
}

.artwork-info .artist-name {
    color: #ff6f61;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.artwork-info .artwork-description {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: justify;
}

/* Các tag thể loại */
.artwork-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.artwork-tag {
    padding: 6px 15px;
    background: rgba(255, 111, 97, 0.2);
    border: 1px solid rgba(255, 111, 97, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #ff6f61;
    font-weight: 500;
    transition: all 0.3s ease;
}

.artwork-tag:hover {
    background: rgba(255, 111, 97, 0.3);
    transform: scale(1.05);
}

/* Nút phân trang */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 50px;
}

.pagination button {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.pagination button:hover {
    background: rgba(255, 111, 97, 0.8);
    border-color: #ff6f61;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 111, 97, 0.3);
}

.pagination button.active {
    background: #ff6f61;
    border-color: #ff6f61;
    box-shadow: 0 5px 15px rgba(255, 111, 97, 0.4);
}

/* Hiệu ứng loading khi tải nội dung */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #ff6f61;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading p {
    color: #ccc;
    font-size: 1.1rem;
}

/* Footer */
footer {
    background-color: rgba(34, 34, 34, 0.95);
    padding: 40px 20px;
    color: var(--light-text);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--light-text);
    opacity: 0.8;
    font-size: 16px;
    transition: all var(--transition-speed) ease;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: translateY(-2px);
    display: inline-block;
}

footer p {
    font-size: 14px;
    opacity: 0.7;
}

.footer-social {
    margin: 20px 0;
}

.footer-social a {
    margin: 0 15px;
    color: var(--light-text);
    font-size: 24px;
    transition: all var(--transition-speed) ease;
}

.footer-social a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
    text-shadow: 0 0 10px rgba(230, 184, 0, 0.5);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-container {
        padding: 0 15px;
    }

    .artwork-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 1024px) {
    body {
        padding-top: 70px;
    }

    nav {
        padding: 12px 0;
    }

    .nav-container {
        flex-direction: row;
        align-items: center;
        padding: 0 10px;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-links li a {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .library-header {
        padding: 80px 15px 60px;
    }

    .library-header h1 {
        font-size: 2.8rem;
    }

    .library-header p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    nav {
        padding: 10px 0;
    }

    .nav-container {
        flex-direction: column;
        align-items: stretch;
        padding: 0 10px;
    }

    .logo-container {
        justify-content: space-between;
        width: 100%;
        margin-bottom: 10px;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    .nav-right {
        justify-content: center;
        gap: 15px;
    }

    .search-bar input {
        width: 150px;
    }

    .library-header {
        padding: 60px 15px 50px;
    }

    .library-header h1 {
        font-size: 2.2rem;
    }

    .library-header p {
        font-size: 1rem;
    }

    .library-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .filter-tabs {
        justify-content: center;
        gap: 10px;
    }

    .filter-tab {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .sort-search {
        justify-content: center;
        flex-wrap: wrap;
    }

    .search-box {
        width: 100%;
        max-width: 300px;
    }

    .artwork-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .artwork-image {
        height: 220px;
    }

    .artwork-info {
        padding: 20px;
    }

    .artwork-info h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 50px;
    }

    .library-header h1 {
        font-size: 1.8rem;
    }

    .library-header p {
        font-size: 0.9rem;
    }

    .artwork-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .filter-tabs {
        gap: 8px;
    }

    .filter-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}