/* Reset CSS cơ bản */
body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    background: #f5f7fa;
    color: #223;
}

/* Thanh màu xanh lam ở trên cùng */
.topbar {
    background: #204080;
    color: #fff;
    padding: 8px 0;
    text-align: right;
    font-size: 0.95rem;
    padding-right: 2rem;
}

/* Logo và thanh điều hướng chính nav */
header {
    background: #fff;
    box-shadow: 0 2px 12px rgba(32, 64, 128, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.7rem;
    font-weight: 700;
    color: #204080;
    text-decoration: none;
    letter-spacing: 2px;
    white-space: nowrap; /* Thêm dòng này để không bị xuống dòng */
}

.logo img {
    height: 42px;
    margin-right: 12px;
    animation: spin 6s linear infinite;
    filter: drop-shadow(0 1px 8px #bbc);
}

@keyframes spin {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Main menu */
nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu {
    display: flex;
    list-style: none;
    gap: 1.2rem;
    margin: 0;
}

.menu>li {
    position: relative;
}

.menu>li>a {
    color: #204080;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background 0.17s, color 0.17s;
}

.menu>li>a:hover {
    background: #e4e9f7;
    color: #ffb800;
}

.menu > li > a,
.footer-contact,
.footer-location {
    white-space: nowrap;
}

/* Danh sách thả xuống */
.submenu {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    background: #fff;
    min-width: 170px;
    box-shadow: 0 8px 24px 0 rgba(32, 64, 128, 0.13);
    border-radius: 0 0 10px 10px;
    z-index: 999;
    animation: dropdown-fade 0.24s;
}

@keyframes dropdown-fade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu li {
    list-style: none;
}

.submenu a {
    display: block;
    padding: 10px 18px;
    color: #204080;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0;
    transition: background 0.14s, color 0.14s;
}

.submenu a:hover {
    background: #ffb800;
    color: #fff;
}

.menu li:hover .submenu,
.menu li:focus-within .submenu {
    display: block;
}

/* Thanh tìm kiếm */
.searchbar {
    display: flex;
    align-items: center;
    background: #f7f9fb;
    padding: 4px 12px;
    border-radius: 18px;
    box-shadow: 0 2px 7px 0 #e4e9f7;
    margin-left: 1.5rem;
}

.searchbar input[type="text"] {
    border: none;
    background: transparent;
    padding: 6px 6px;
    font-size: 1rem;
    outline: none;
    width: 140px;
}

.searchbar button {
    background: #ffb800;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.searchbar button:hover {
    background: #204080;
}

/* Biểu ngữ */
.banner {
    max-width: 1100px;
    margin: 2rem auto 0 auto;
    background: linear-gradient(90deg, #e8eefa 80%, #ffe9b8 100%);
    border-radius: 1.2rem;
    box-shadow: 0 8px 32px 0 rgba(32, 64, 128, 0.10);
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1.5rem 2rem;
}

.banner-content {
    flex: 1 1 350px;
}

.banner-title {
    font-size: 2rem;
    font-weight: 700;
    color: #204080;
    margin-bottom: 0.5rem;
}

.banner-desc {
    color: #444;
    font-size: 1.1rem;
    margin-bottom: 1.1rem;
}

.banner-img {
    max-width: 270px;
    width: 100%;
    border-radius: 1.2rem;
    box-shadow: 0 4px 24px rgba(32, 64, 128, 0.10);
    animation: float 4s ease-in-out infinite alternate;
}

@keyframes float {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-14px);
    }
}

/* Thư viện sách */
.gallery-section {
    max-width: 1100px;
    margin: 2.2rem auto 2rem auto;
    padding: 0 2rem;
}

.gallery-title {
    font-size: 1.3rem;
    color: #204080;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

/* Giữ kích thước sách khi lọc kết quả */
.gallery>a {
    max-width: 220px;
    min-width: 0;
    margin: 0 auto;
}

.book-card {
    background: #fff;
    border-radius: 0.8rem;
    box-shadow: 0 6px 20px 0 rgba(32, 64, 128, 0.09);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.book-card:hover {
    transform: translateY(-6px) scale(1.035) rotate(-1deg);
    box-shadow: 0 12px 28px 0 rgba(32, 64, 128, 0.16);
    z-index: 2;
}

.book-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: filter 0.2s;
    filter: grayscale(15%) brightness(1.07);
}

.book-card:hover .book-img {
    filter: none;
}

.caption {
    padding: 0.4rem 0.7rem 0.4rem 0.7rem;
    margin-top: 0;
    background: #f8fafd;
    color: #204080;
    font-weight: 500;
    min-height: 40px;
    box-sizing: border-box;
    text-align: left;
    position: relative;
    z-index: 2;
}

.caption strong {
    color: #204080;
    font-size: 1.05rem;
    font-weight: 700;
    display: block;
}

.caption em {
    color: #666;
    font-size: 0.98rem;
}

/* Chân trang */
footer {
    background: #204080;
    color: #fff;
    padding: 2rem 1rem 1.2rem 1rem;
    text-align: center;
    font-size: 1rem;
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -2px 18px rgba(32, 64, 128, 0.08);
    margin-top: auto;
}

.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-left {
    text-align: left;
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 260px;
    padding-left: 140px;
}

.footer-contact,
.footer-location {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    word-break: break-word;
}

.footer-contact strong,
.footer-location strong {
    margin-right: 2px;
}

.footer-contact span,
.footer-location span {
    flex: 1;
    word-break: break-word;
}

.footer-contact {
    margin-bottom: 0.7rem;
    font-size: 1.1rem;
}

.footer-location {
    font-size: 1.01rem;
    margin-bottom: 0.5rem;
    opacity: 0.92;
}

.footer-note {
    margin-top: 0.7rem;
    font-size: 0.95rem;
    opacity: 0.80;
    margin-left: 100px;
}

.logo-footer {
    font-size: 2.1rem;
    font-weight: 700;
    color: #ffb800;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

.logo-footer img {
    height: 48px;
    margin-right: 12px;
    vertical-align: middle;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    flex: 1 1 350px;
}

.footer-author {
    display: block;
    font-size: 1rem;
    color: #fff;
    margin-top: 6px;
    text-align: right;
    margin-right: 140px;
    width: 100%;
}

.footer-author-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.18s;
}

.footer-author-link:hover {
    color: #ffb800;
    text-decoration: underline;
}

/* Nút điều khiển video banner */
#toggleMuteBtn, #volDownBtn, #volUpBtn, #playPauseBtn {
    box-shadow: 0 2px 8px rgba(32,64,128,0.18);
    transition: background 0.18s, transform 0.14s, box-shadow 0.18s;
    outline: none;
    border: none;
    background: rgba(32,64,128,0.85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    opacity: 0.92;
}
#toggleMuteBtn:hover, #volDownBtn:hover, #volUpBtn:hover, #playPauseBtn:hover {
    background: #ffb800;
    color: #204080;
    transform: scale(1.13) rotate(-8deg);
    box-shadow: 0 4px 16px rgba(255,184,0,0.18);
    opacity: 1;
}
#toggleMuteBtn:active, #volDownBtn:active, #volUpBtn:active, #playPauseBtn:active {
    background: #204080;
    color: #fff;
    transform: scale(0.97);
}

.video-ctrl-btn {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: rgba(32,64,128,0.85);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(32,64,128,0.18);
    transition: background 0.18s, transform 0.14s, box-shadow 0.18s;
    opacity: 0.92;
    cursor: pointer;
}
.video-ctrl-btn:hover {
    background: #ffb800;
    color: #204080;
    transform: scale(1.13) rotate(-8deg);
    box-shadow: 0 4px 16px rgba(255,184,0,0.18);
    opacity: 1;
}
.video-ctrl-btn:active {
    background: #204080;
    color: #fff;
    transform: scale(0.97);
}

.video-controls {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(100%);
    display: flex;
    gap: 10px;
    z-index: 2;
    margin-top: 8px;
}

/* Phản hồi */
@media (max-width: 700px) {
    .banner {
        flex-direction: column;
        padding: 1rem;
    }

    .banner-img {
        max-width: 140px;
    }

    .header-container {
        padding: 1rem 0.5rem;
    }

    .gallery-section,
    .banner {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .gallery {
        gap: 0.7rem;
    }

    .book-card {
        border-radius: 0.45rem;
    }

    .book-img {
        height: 90px;
    }

    footer {
        border-radius: 0.8rem 0.8rem 0 0;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo img {
        height: 30px;
    }

    .searchbar input[type="text"] {
        width: 70px;
    }
}

.footer-email {
    text-decoration: none;
    color: inherit;
    transition: color 0.18s;
}

.footer-email:hover {
    color: #ffb800;
    text-decoration: underline;
}

.footer-label {
  min-width: 90px;
  width: 150px; /* tăng width cho đều */
  display: inline-block
}
.footer-author1{
    margin-right: 60px;
    font-size: 1rem;
    color: #fff;
    text-align: right;
}