/* ============================================================
   LIBRARY PAGE STYLES
   Kế thừa header + side-nav từ masterplan.css
   Bố cục 6-4: 60% media / 40% text, full-screen background
   ============================================================ */

body {
    background-color: #000;
}

/* Logo Particle Effect */
.logo-wrapper {
    position: relative;
    display: inline-block;
}

.logo {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.logo-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.logo-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-gold);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

#library-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.library-section {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    visibility: hidden;
}

.library-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    filter: brightness(0.9);
    transform: scale(1.02);
}

/* Background sử dụng ảnh từ assets */
.bg-images {
    background-image: url('../assets/library/library1.png');
}

.bg-video {
    background-image: url('../assets/library/library2.png');
    opacity: 0.6;
}

.bg-resources {
    background-image: url('../assets/library/library3.png');
}

.library-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5vw;
}

/* Dark overlay nhẹ cho background */
.library-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
    pointer-events: none;
}

.library-content,
.map-area,
.design-container {
    position: relative;
    z-index: 2;
}

/* ============================================================
   MEDIA / TEXT PANEL (6-4)
   ============================================================ */
.media-panel {
    width: 100%;
    max-width: 1440px;
    display: flex;
    justify-content: flex-start;
    margin-top:-50px;
}

.media-card {
    position: relative;
    width: calc(100% - 200px);
    min-width: 640px;
    max-width: 1200px;
    height: 70vh;
    min-height: 600px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.media-card.image-card .media-main img,
.media-card.video-card .media-main video {
    width: 100%;
    height: 100%;    
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

/* Hover nhẹ cho ảnh & video */
.media-card.image-card:hover .media-main img,
.media-card.video-card:hover .media-main video {
    transform: scale(1.05);
}

/* ============================================================
   IMAGE CAROUSEL & VIDEO CAROUSEL
   ============================================================ */
.image-carousel{
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.video-carousel {
    position: relative;
    width: calc(100% - 200px);
    height: 100%;
    overflow: hidden;
}
.video-carousel{
    margin-left:100px;
    display: block;
}
.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
}

.media-main {
    position: relative;
    width: 100%;
    height: 100%;
    max-height:550px;
    z-index: 1;
}

.media-overlay {
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(359deg, #003312 27.63%, rgba(0, 51, 18, 0.00) 99.3%);
}

#section-video .media-overlay{
    background:unset;
}

#section-video .media-card{
    box-shadow: unset;
}

#section-video .carousel-arrow-prev, #section-video .carousel-arrow-next{
    top: calc(50% - 100px);
} 
.media-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 48px 32px;
    color: #fff;
    font-family: 'Poppins';
    z-index: 3;
}
#section-video .media-card{
    min-height:800px;
}
#section-video .media-text{
    bottom:unset;
    padding: 30px 0px;
}
.video-wrapper {
    background: #000;
}

.hero-video {
    width: 100%;
    height: 100%;
}

.video-overlay-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* YouTube iframe responsive */
.youtube-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.youtube-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.play-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    background: rgba(0, 0, 0, 0.35);
}

/* Carousel Arrow Buttons */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow-prev {
    left: 20px;
}

.carousel-arrow-next {
    right: 20px;
}

/* Carousel Pagination */
.carousel-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    padding: 8px 16px;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.pagination-dot.active {
    width: 44px;
    height: 8px;
    border-radius: 4px;
    background: #fff;
}

.pagination-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.media-heading {
    font-family: "Poppins";
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 16px;
}

.media-description {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 24px;
}

.media-btn {
    padding: 10px 28px;
    border-radius: 999px;
    border: 1px solid #ffffff;
    background: transparent;
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.04em;
    font-weight: 500;
    transition: 0.25s ease;
}

.media-btn:hover {
    background: #fff;
    color: #21362C;
}

/* ============================================================
   RESOURCES - Layout ngang 2 cột, căn trái, có carousel
   ============================================================ */
.resources-panel {
    width: 100%;
    max-width: 1440px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.resources-carousel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    overflow: visible;
    padding-bottom: 50px;
    /* Thêm padding để có không gian cho pagination */
}

.resources-track {
    position: relative;
    width: calc(100% - 200px);
    margin-left: 100px;
    display: block;
    max-width: 1000px;
}

.resources-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.resources-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

.resource-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 330px;
    cursor: default;
}

.resource-thumb {
    height: 410px;
    /* Tăng chiều cao để thiên về dọc */
    background: linear-gradient(135deg, #ccd7c5 0%, #f5f5f5 60%, #d6e0d3 100%);
    transition: transform 0.45s ease;
}

/* Hover cho thẻ tài nguyên */
.resource-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.resource-card:hover .resource-thumb {
    transform: scale(1.03);
}

/* Resources Carousel Arrows */
.resources-carousel {
    position: relative;
}

.resources-carousel .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.resources-carousel .carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.resources-carousel .carousel-arrow-prev {
    left: 20px;
}

.resources-carousel .carousel-arrow-next {
    right: 20px;
}

#section-resources .carousel-arrow-prev, #section-resources .carousel-arrow-next{
    top: calc(50% - 100px);
} 

/* Resources Pagination */
.resources-pagination {
    position: absolute;
    bottom: 10px;
    /* Đặt ở vị trí dương, cách dưới các thẻ một khoảng */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    padding: 8px 16px;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.resource-body {
    padding: 15px 0px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
}

.resource-text {
    font-size: 13px;
    line-height: 1.7;
    color: #fff;
    margin-bottom: 12px;
}

.resource-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#section-resources .media-card {
    max-width: 1200px;
    border-radius: 0px;
}
#section-resources .media-card {
    box-shadow: unset;
}

.icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 0px solid #21362C;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    transition: 0.2s ease;
}

.icon-btn:hover {
    background: #21362C;
    color: #CEB472;
}

.icon-zoom {
    font-weight: 600;
}

.icon-download {
    font-size: 16px;
}



#section-video .media-card{
    max-width:1064px;
        border-radius: 0px;
}
#section-video .carousel-pagination{
    display:none;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .media-card {
        width: 80%;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    #library-wrapper {
        height: 100vh;
    }

    .library-section {
        align-items: flex-end;
    }

    .library-content {
        padding: 0 16px 32px;
        align-items: flex-end;
    }

    .media-card {
        width: 100%;
        min-width: 0;
        border-radius: 18px;
    }

    .media-text {
        padding: 20px 18px 18px;
    }

    .media-heading {
        font-size: 18px;
    }

    .media-description {
        font-size: 12px;
    }

    .resources-panel {
        justify-content: center;
    }

    .resources-carousel {
        max-width: 100%;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .resource-card {
        max-width: 100%;
    }

    .resource-thumb {
        height: 200px;
    }
}

@media (max-height: 800px) {
    .media-panel{max-width:940px;}
    .resource-thumb{height:350px;}
}