/**
 * HDev Library Module - Common Styles
 * Shared styles for both Image Grid and Video Carousel tabs
 */

/* ===================================
   SECTION LAYOUT
   =================================== */
.hdev-library-section {
    width: 100%;
    display: flex;
    align-items: center;
}

.hdev-library-container {
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

/* ===================================
   HEADER: Titles (Left) + Tabs (Right)
   =================================== */
.hdev-library-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Titles Container (Left side) */
.hdev-library-titles {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hdev-library-title-1 {
    font-family: var(--hdev-font-subheading);
    font-size: var(--hdev-fs-subheading-opt);
    background: var(--hdev-color-heading-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 5px;
    font-weight: 300;
    text-shadow: none;
    text-transform: none;
    line-height: 1.2;
}

.hdev-library-title-2 {
    font-family: var(--hdev-font-heading);
    font-size: var(--hdev-fs-heading-opt);
    background: var(--hdev-color-heading-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.1;
}

/* ===================================
   TABS NAVIGATION (Right side)
   =================================== */
.hdev-library-tabs {
    display: flex;
    align-items: center;
}

.hdev-library-tab {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--hdev-font-heading);
    font-size: var(--hdev-fs-nav-tabs);
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    padding: 0;
    position: relative;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hdev-library-tab:hover {
    color: #14593C;
}

.hdev-library-tab-diamond {
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

.hdev-library-tab.active {
    color: #14593C;
}

.hdev-library-tab.active .hdev-library-tab-diamond {
    background: #14593C;
}

/* ===================================
   TAB CONTENT
   =================================== */
.hdev-library-tab-content {
    display: none;
}

.hdev-library-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

/* ===================================
   POPUP / LIGHTBOX - FULL SCREEN UPGRADE
   =================================== */
.hdev-library-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: #000;
    /* Full black background for cinema mode */
}

.hdev-library-popup.active {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

.hdev-library-popup-overlay {
    /* Overlay is now just for background click interactions if needed, main bg is on parent */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
    z-index: 1;
}

.hdev-library-popup-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    /* Remove constraints */
    background: transparent;
    padding: 0;
    /* Remove padding */
    z-index: 10;
    overflow: hidden;
    /* Hide scrollbars */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hdev-library-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 100002;
    /* Topmost z-index */
    pointer-events: auto;
}

.hdev-library-popup-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.hdev-library-popup-close svg {
    width: 35px;
    height: 35px;
    stroke-width: 2;
}

.hdev-library-popup-title {
    position: absolute;
    top: 30px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'UTM Americana', serif;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin: 0;
    z-index: 100;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Main Image Slider - Full Screen Experience */
.hdev-library-popup-main {
    width: 100%;
    height: 100%;
    margin: 0;
    position: relative;
    z-index: 10;
}

.hdev-library-popup-main .slick-list,
.hdev-library-popup-main .slick-track {
    height: 100% !important;
}

.hdev-library-popup-main-item {
    width: 100vw;
    height: 100vh;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.hdev-library-popup-main-item img {
    width: 100vw;
    height: 100vh;
    max-height: none;
    /* Remove constraints */
    /* Fill the screen */
    display: block;
    border-radius: 0;
    box-shadow: none;
}

.hdev-library-popup-main-item iframe {
    width: 80%;
    height: 80%;
    max-width: 1200px;
    aspect-ratio: 16/9;
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Thumbnail Navigation - Floating Bottom Bar */
.hdev-library-popup-thumbs {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    /* backdrop-filter: blur(10px);*/
    z-index: 100;
    margin-top: 0;
}

.hdev-library-popup-thumb-item {
    cursor: pointer;
    margin: 0 5px;
    opacity: 0.4;
    transition: all 0.3s ease;
    display: block !important;
    padding: 2px;
}

.hdev-library-popup-thumb-item:hover,
.hdev-library-popup-thumb-item.slick-current {
    opacity: 1;
    transform: scale(1.05);
}

.hdev-library-popup-thumb-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    background: #000;
}

.hdev-library-popup-thumb-item.slick-current img {
    border-color: var(--color-secondary);
}

/* Slick Arrows - Thumbnails */
.hdev-library-popup-thumbs .slick-arrow {
    width: 30px;
    height: 30px;
    background: transparent;
    border-radius: 50%;
    z-index: 10;
}

.hdev-library-popup-thumbs .slick-arrow:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hdev-library-popup-thumbs .slick-prev {
    left: -35px;
}

.hdev-library-popup-thumbs .slick-next {
    right: -35px;
}

.hdev-library-popup-thumbs .slick-arrow:before {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

/* Hide fullPage.js navigation and other UI when popup is active */
/* Hide fullPage.js navigation and other UI when popup is active */
.hdev-library-popup.active~#fp-nav {
    display: none !important;
}

body.hdev-popup-open {
    overflow: hidden !important;
}

body.hdev-popup-open #main {
    /* Hide main content visually but keep layout */
    visibility: hidden !important;
}

body.hdev-popup-open .hdev-library-popup {
    visibility: visible !important;
}

/* ===================================
   RESPONSIVE DESIGN - COMMON / POPUP
   =================================== */

/* Desktop screens */
@media (min-width: 1600px) {
    .hdev-library-section {
        min-height: 100vh;
    }

    .hdev-library-container {
        max-width: var(--container-width-md);
    }

    .hdev-library-header {
        margin-bottom: 60px;
    }
}

/* Laptop screens */
@media (max-width: 1599px) and (min-width: 850px) {
    .hdev-library-container {
        max-width: var(--container-width-xs);
        margin-top: 80px;
    }

    .hdev-library-header {
        margin-bottom: 30px;
    }
}

/* Tablet / Mobile Popup Adjustments */
@media (max-width: 1024px) {
    .hdev-library-popup-main-item img {
        max-height: 75vh;
    }

    .hdev-library-popup-thumbs {
        width: 90%;
        bottom: 20px;
    }
}

@media (max-width: 768px) {
    .hdev-library-section {
        min-height: auto;
        padding: 60px 0;
    }

    .hdev-library-container {
        padding: 0 15px !important;
        /* Reduced side padding */
    }

    .hdev-library-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
        margin-top: 20px;
        /* Reduced margin */
    }

    .hdev-library-tabs {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .hdev-library-tab {
        font-size: 13px;
    }

    /* Mobile Popup */
    .hdev-library-popup-title {
        font-size: 18px;
        top: 15px;
    }

    .hdev-library-popup-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .hdev-library-popup-main-item img {
        width: auto !important;
        height: auto !important;
        max-width: 95vw !important;
        max-height: 60vh !important;
        object-fit: contain !important;
        margin: 0 auto;
        border-radius: 8px;
    }

    .hdev-library-popup-close svg {
        stroke: #fff !important;
    }

    .hdev-library-popup-main-item,
    .hdev-library-popup-main-item img {
        margin: 0 auto;
        justify-content: center;
    }

    /* Move image down using flex-end alignment */
    .hdev-library-popup-main-item {
        margin-top: 0;
        align-items: flex-end !important;
        /* Push image to bottom */
        padding-bottom: 130px;
        /* Space for thumbnails */
    }

    .hdev-library-popup-thumbs {
        width: 100%;
        padding: 8px 0;
        bottom: 80px;
        /* Lift thumbnails up considerably */
        z-index: 1000;
        margin-top: 0;
        background: rgba(0, 0, 0, 0.4);
        left: 0;
        transform: none;
    }

    .hdev-library-popup-thumb-item {
        margin: 0 3px;
    }

    .hdev-library-popup-thumb-item img {
        height: 50px;
    }
}