/**
 * Hero Slider Widget CSS
 *
 * Modern hero slider styles using Swiper.js.
 * Scoped under .vnpa-hero-slider to avoid conflicts.
 *
 * Includes Swiper base structural styles to ensure proper rendering
 * even when Elementor's Swiper CSS is not loaded for custom widgets.
 */

/* ==========================================
   SWIPER BASE STRUCTURAL STYLES
   (Required for proper slider layout)
   ========================================== */

.vnpa-hero-slider .swiper {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
    display: block;
}

.vnpa-hero-slider .swiper-vertical > .swiper-wrapper {
    flex-direction: column;
}

.vnpa-hero-slider .swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    transition-property: transform;
    box-sizing: content-box;
}

.vnpa-hero-slider .swiper-android .swiper-slide,
.vnpa-hero-slider .swiper-wrapper {
    transform: translate3d(0, 0, 0);
}

.vnpa-hero-slider .swiper-horizontal {
    touch-action: pan-y;
}

.vnpa-hero-slider .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
    display: block;
}

.vnpa-hero-slider .swiper-slide-invisible-blank {
    visibility: hidden;
}

/* Auto-height */
.vnpa-hero-slider .swiper-autoheight,
.vnpa-hero-slider .swiper-autoheight .swiper-slide {
    height: auto;
}

.vnpa-hero-slider .swiper-autoheight .swiper-wrapper {
    align-items: flex-start;
    transition-property: transform, height;
}

/* Backface hidden (3D transforms fix) */
.vnpa-hero-slider .swiper-backface-hidden .swiper-slide {
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ==========================================
   SLIDER WRAPPER
   ========================================== */

.vnpa-hero-slider {
    position: relative;
    width: 100%;
}

/* Default viewport height matching design: 75vh mobile, 85vh desktop */
.vnpa-hero-slider .swiper,
.vnpa-hero-slider .swiper-slide {
    height: 75vh;
}

@media (min-width: 1024px) {
    .vnpa-hero-slider .swiper,
    .vnpa-hero-slider .swiper-slide {
        height: 85vh;
    }
}

/* ==========================================
   SLIDE STYLES
   ========================================== */

.vnpa-hero-slider .swiper-slide {
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f3f4f6; /* gray-100 fallback */
}

.vnpa-hero-slider .swiper-slide-active {
    z-index: 1;
}

/* ==========================================
   SLIDE OVERLAY — Gradient (design matching)
   Left-to-right: white/90 → white/50 → transparent
   ========================================== */

.vnpa-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    /* Default: design-matching left-to-right gradient */
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(255, 255, 255, 0.6) 40%,
        rgba(255, 255, 255, 0.2) 70%,
        transparent 100%
    );
}

/* ==========================================
   SLIDE INNER / CONTENT WRAPPER
   ========================================== */

.vnpa-slide-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 24px;
}

/* Content container matching design's max-w-[1440px] centered layout */
.vnpa-slide-content {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Inner content block matching design's max-w-xl (~576px) */
.vnpa-slide-content-wrap {
    max-width: 576px;
}

/* ==========================================
   CONTENT ANIMATIONS (only when Swiper is active)
   ========================================== */

.vnpa-hero-slider.swiper-initialized .swiper-slide-active .vnpa-slide-subtitle,
.vnpa-hero-slider.swiper-initialized .swiper-slide-active .vnpa-slide-title,
.vnpa-hero-slider.swiper-initialized .swiper-slide-active .vnpa-slide-description,
.vnpa-hero-slider.swiper-initialized .swiper-slide-active .vnpa-slide-buttons {
    animation: vnpaFadeSlideUp 0.6s ease-out both;
}

.vnpa-hero-slider.swiper-initialized .swiper-slide-active .vnpa-slide-title {
    animation-delay: 0.15s;
}

.vnpa-hero-slider.swiper-initialized .swiper-slide-active .vnpa-slide-description {
    animation-delay: 0.3s;
}

.vnpa-hero-slider.swiper-initialized .swiper-slide-active .vnpa-slide-buttons {
    animation-delay: 0.45s;
}

@keyframes vnpaFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   SUBTITLE — Design: mono, xs/sm, sky blue, uppercase, tracking 0.2em
   ========================================== */

.vnpa-slide-subtitle {
    margin: 0 0 16px;
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #0072FF; /* brand-sky */
}

@media (min-width: 1024px) {
    .vnpa-slide-subtitle {
        font-size: 14px;
    }
}

/* ==========================================
   TITLE — Design: display font, 4xl/7xl, bold, leading-[0.95], dark
   ========================================== */

.vnpa-slide-title {
    margin: 0 0 24px;
    font-family: 'Sora', 'Plus Jakarta Sans', 'Montserrat', sans-serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.025em;
    color: #111827; /* brand-dark */
}

@media (min-width: 1024px) {
    .vnpa-slide-title {
        font-size: 72px;
    }
}

/* ==========================================
   DESCRIPTION — Design: base/lg, font-light, muted, max-w-md
   ========================================== */

.vnpa-slide-description {
    margin: 0 0 32px;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.625;
    color: #6B7280; /* brand-muted */
    max-width: 448px; /* max-w-md ≈ 28rem = 448px */
}

@media (min-width: 1024px) {
    .vnpa-slide-description {
        font-size: 18px;
    }
}

/* ==========================================
   BUTTONS — Design: pill-shaped (rounded-full), gap-4
   ========================================== */

.vnpa-slide-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.vnpa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    line-height: 1;
    box-sizing: border-box;
}

/* Primary Button — Design: dark bg, white text, rounded-full, shadow */
.vnpa-btn--primary {
    padding: 16px 32px;
    font-size: 14px;
    color: #ffffff;
    background-color: #111827; /* brand-dark */
    border-color: #111827;
    border-radius: 9999px; /* rounded-full */
    box-shadow: 0 10px 15px -3px rgba(17, 24, 39, 0.2); /* shadow-lg shadow-brand-dark/20 */
}

.vnpa-btn--primary:hover {
    color: #ffffff;
    background-color: rgba(17, 24, 39, 0.85); /* brand-dark/85 */
    border-color: rgba(17, 24, 39, 0.85);
}

/* Secondary Button — Design: white bg, dark text, border, rounded-full, shadow-sm */
.vnpa-btn--secondary {
    padding: 16px 32px;
    font-size: 14px;
    color: #111827; /* brand-dark */
    background-color: #ffffff;
    border-color: #E5E7EB; /* brand-border */
    border-radius: 9999px; /* rounded-full */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
}

.vnpa-btn--secondary:hover {
    color: #111827;
    background-color: #f9fafb; /* gray-50 */
    border-color: #E5E7EB;
}

/* ==========================================
   NAVIGATION ARROWS
   ========================================== */

.vnpa-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #111827;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid #E5E7EB;
    outline: none;
}

.vnpa-slider-arrow svg {
    width: 20px;
    height: 20px;
}

.vnpa-slider-arrow:hover {
    background-color: #111827;
    color: #ffffff;
    border-color: #111827;
    transform: translateY(-50%) scale(1.05);
}

.vnpa-slider-arrow--prev {
    left: 20px;
}

.vnpa-slider-arrow--next {
    right: 20px;
}

/* ==========================================
   PAGINATION DOTS — Design: pill-shaped bars (w-8 h-1)
   ========================================== */

.vnpa-hero-slider .swiper-pagination {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    left: 0;
    right: 0;
}

.vnpa-hero-slider .vnpa-pagination-bottom {
    bottom: 32px;
}

.vnpa-hero-slider .vnpa-pagination-top {
    top: 32px;
}

.vnpa-hero-slider .swiper-pagination-bullet {
    width: 32px;
    height: 4px;
    border-radius: 9999px;
    background-color: rgba(17, 24, 39, 0.2); /* brand-dark/20 */
    opacity: 1;
    transition: all 0.3s ease;
}

.vnpa-hero-slider .swiper-pagination-bullet-active {
    background-color: #111827; /* brand-dark */
    width: 32px;
    border-radius: 9999px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (min-width: 1024px) {
    .vnpa-slide-inner {
        padding: 48px 10px;
    }

    .vnpa-slide-content {
        padding: 0 48px;
    }
}

@media (max-width: 768px) {
    .vnpa-slide-title {
        font-size: 28px;
    }

    .vnpa-slide-description {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .vnpa-btn--primary,
    .vnpa-btn--secondary {
        padding: 12px 24px;
        font-size: 13px;
    }

    .vnpa-slider-arrow {
        width: 40px;
        height: 40px;
    }

    .vnpa-slider-arrow--prev {
        left: 10px;
    }

    .vnpa-slider-arrow--next {
        right: 10px;
    }

    .vnpa-hero-slider .vnpa-pagination-bottom {
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .vnpa-slide-title {
        font-size: 24px;
    }

    .vnpa-slide-subtitle {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .vnpa-slide-description {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .vnpa-slide-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .vnpa-slide-buttons .vnpa-btn {
        text-align: center;
    }

    .vnpa-slide-buttons .vnpa-btn + .vnpa-btn {
        margin-left: 0 !important;
    }

    .vnpa-slide-inner {
        padding: 16px;
    }

    .vnpa-slide-content {
        padding: 0 8px;
    }
}
