/**
 * Swiper Slider Pro - Frontend Styles (Clean Rewrite)
 * 
 * Fullscreen layout compatible with fullPage.js
 * Minimal use of !important - only where absolutely necessary
 */

/* ============================================
   CRITICAL: fullPage.js Compatibility
   ============================================ */

/* Force full width for section containing slider */
section.hdev-fullpage:has(.hdev-dongchay-fullscreen-wrapper)>.section-content {
    max-width: none;
    width: 100vw;
    height: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Force children full width/height (ONLY for sections with slider) */
section.hdev-fullpage:has(.hdev-dongchay-fullscreen-wrapper) .section-content>*,
section.hdev-fullpage:has(.hdev-dongchay-fullscreen-wrapper)>* {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* ==================== Slider Container ==================== */
.hdev-fullpage .hdev-dongchay-fullscreen-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    overflow: hidden;
    z-index: 1;
}

/* Fallback when NOT inside fullpage section */
.hdev-dongchay-fullscreen-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    z-index: 1;
}

/* ==================== Swiper Container ==================== */
.hdev-dongchay-container {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

/* ==================== Swiper Container ==================== */
.hdev-dongchay-container .swiper-wrapper {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
}

.hdev-dongchay-container .swiper-slide {
    position: relative;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* ==================== Background Image ==================== */
.hdev-dongchay-container .slide-bg {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    object-fit: cover;
    object-position: center;
    object-position: center;
    display: block;
}

/* Default: Show Desktop, Hide Mobile */
.hdev-dongchay-container .slide-bg-mobile {
    display: none !important;
}

.hdev-dongchay-container .slide-bg-desktop {
    display: block !important;
    opacity: 1 !important;
}

/* ==================== Gradient Overlays ==================== */
.hdev-dongchay-container .overlay-top {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 14rem;
    background: linear-gradient(0deg, rgba(0, 79, 56, .9) 0%, rgba(0, 79, 56, .9) .01%, rgba(0, 79, 56, .74) 41.45%, rgba(0, 79, 56, 0) 100%);
    z-index: 1;
    transform: rotate(180deg);
    pointer-events: none;
}

.hdev-dongchay-container .overlay-bottom {
    content: '';
    position: absolute;
    top: 70%;
    left: 0;
    width: 100%;
    bottom: 0;
    z-index: 2;
    background: linear-gradient(0deg, rgba(0, 27, 19, .9) 0%, rgba(0, 27, 19, .74) 52%, rgba(0, 27, 19, 0) 100%);
    pointer-events: none;
}

/* ==================== Slide Content - Desktop ==================== */
.hdev-dongchay-container .slide-content {
    position: absolute;
    bottom: 33%;
    left: 0;
    right: 0;
    z-index: 5;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
}

.hdev-dongchay-container .slide-title {
    color: #ffffff;
    font-size: var(--hdev-fs-h2);
    font-weight: 300;
    font-family: var(--hdev-font-heading);
    text-align: left;
    text-transform: uppercase;
    line-height: 1.4;
    padding: 0;
    max-width: 770px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* ==================== Diamond Pagination - Desktop ==================== */
/* Pagination wrapper - uses Flatsome container for alignment with title */
.hdev-dongchay-pagination-wrapper {
    position: absolute;
    bottom: 10%;
    left: 0;
    right: 0;
    z-index: 9998;
    pointer-events: none;
}

/* Pagination - aligned left inside container (same as title) */
.hdev-dongchay-container .swiper-pagination {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    width: auto;
    max-width: 1200px;
    margin: 0 auto;
    left: 0;
    bottom: auto;
    transform: none;
    pointer-events: all;
}

/* Round bullets styling with cyan/blue color */
.hdev-dongchay-container .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(135, 206, 235, 0.6);
    /* Light blue/cyan */
    opacity: 1;
    border: none;
    border-radius: 50%;
    /* Perfectly round */
    transform: none;
    /* No rotation */
    transition: all 0.3s ease;
    margin: 0;
    cursor: pointer;
}

.swiper-pagination-bullet:hover {
    background: rgba(135, 206, 235, 0.8);
    transform: scale(1.1);
}

.swiper-pagination-bullet-active {
    background: rgba(135, 206, 235, 1);
    /* Full opacity cyan */
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(135, 206, 235, 0.8), 0 0 20px rgba(135, 206, 235, 0.5);
}

/* ==================== Responsive Design ==================== */

/* Laptop Screens: Dynamic padding to align with container */
@media (max-width: 1599px) and (min-width: 850px) {
    .slide-content {
        padding-left: calc((100vw - var(--container-width-md)) / 2);
        padding-right: calc((100vw - var(--container-width-md)) / 2);
    }

    .hdev-dongchay-container .swiper-pagination {
        padding-left: calc((100vw - var(--container-width-md)) / 2);
        padding-right: calc((100vw - var(--container-width-md)) / 2);
    }
}

/* Tablet & Mobile: Disable fullscreen behavior */
@media screen and (max-width: 1024px) {

    /* Disable fullscreen on parent sections */
    section.hdev-fullpage:has(.hdev-dongchay-fullscreen-wrapper)>*,
    section.hdev-fullpage:has(.hdev-dongchay-fullscreen-wrapper) .section-content>* {
        min-height: auto;
    }

    /* Use fixed height instead of 100vh */
    .hdev-dongchay-fullscreen-wrapper,
    .hdev-dongchay-container,
    .swiper-wrapper,
    .swiper-slide {
        min-height: 500px;
        height: auto;
    }

    .slide-bg {
        min-height: 500px;
        height: 100%;
    }
}

/* Mobile Devices */
@media screen and (max-width: 768px) {

    /* Increase height on mobile */
    .hdev-dongchay-fullscreen-wrapper,
    .hdev-dongchay-container,
    .swiper-wrapper,
    .swiper-slide {
        min-height: 550px;
    }

    /* Only hide desktop image IF it has the specific class */
    .hdev-dongchay-container .hdev-hide-on-mobile {
        display: none !important;
    }

    .hdev-dongchay-container .slide-bg-mobile {
        display: block !important;
        opacity: 1 !important;
        position: relative !important;
        /* Fix collapsed height */
        height: 100% !important;
        object-fit: cover;
    }

    .slide-bg {
        min-height: 550px;
    }

    /* Center text content */
    .slide-content {
        top: 50%;
        left: 50%;
        bottom: auto;
        right: auto;
        transform: translate(-50%, -50%);
        padding: 0 30px;
        text-align: center;
        max-width: 100%;
        width: calc(100% - 60px);
        margin-bottom: 40px;
    }

    .slide-title {
        letter-spacing: 0.1em;
        max-width: 100%;
        text-align: center;
        margin: 0 auto;
    }

    /* Center pagination */
    .hdev-dongchay-pagination-wrapper {
        bottom: 120px;
        top: auto;
    }

    .hdev-dongchay-container .swiper-pagination {
        justify-content: center;
        width: 100%;
        padding: 0 30px;
    }

    .swiper-pagination-bullet {
        width: 12px;
        height: 12px;
    }
}

/* Small Mobile Devices */
@media screen and (max-width: 480px) {

    .hdev-dongchay-fullscreen-wrapper,
    .hdev-dongchay-container,
    .swiper-wrapper,
    .swiper-slide {
        min-height: 480px;
    }

    .slide-bg {
        min-height: 480px;
    }

    .slide-content {
        padding: 0 20px;
        width: calc(100% - 40px);
        margin-bottom: 30px;
    }

    .slide-title {
        letter-spacing: 0.08em;
    }

    .hdev-dongchay-pagination-wrapper {
        bottom: 100px;
    }

    .hdev-dongchay-container .swiper-pagination {
        padding: 0 20px;
        gap: 8px;
    }

    .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
    }
}

/* ==================== Animation ==================== */
.swiper-slide-active .slide-title {
    animation: fadeInLeft 0.8s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== Notice Styling ==================== */
.hdev-dongchay-notice {
    padding: 20px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    margin: 20px;
}

/* ==================== Navigation Arrows ==================== */
.swiper-button-prev,
.swiper-button-next {
    display: none;
    /* Hidden by default, shown via JS when navigation is enabled */
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 20px;
    font-weight: bold;
}

/* Show arrows when navigation is enabled (class added via JS) */
.hdev-dongchay-container.nav-enabled .swiper-button-prev,
.hdev-dongchay-container.nav-enabled .swiper-button-next {
    display: flex;
}

@media screen and (max-width: 768px) {

    .swiper-button-prev,
    .swiper-button-next {
        width: 40px;
        height: 40px;
    }

    .swiper-button-prev::after,
    .swiper-button-next::after {
        font-size: 16px;
    }
}