/* =====================================================
   HERO CAROUSEL — Premium Marketing Slider
   Matches LuxStore dark navy / purple neon theme
   ===================================================== */

/* ---- Container ---- */
.hero-carousel-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--bg, #0d0d1a);
    /* margin-top is set dynamically via JS to exactly match the real header height */
    margin-top: var(--header-height, 100px);
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 820px;
    overflow: hidden;
}

/* ---- Slides Track ---- */
.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* ---- Individual Slide ---- */
.carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

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

.carousel-slide.prev {
    opacity: 0;
    visibility: visible;
    z-index: 1;
}

/* ---- Background Layer ---- */
.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: transparent;
    transform: scale(1);
    transition: none;
    will-change: auto;
}

.carousel-slide.active .slide-bg {
    transform: scale(1);
}

/* Demo gradient fallback backgrounds */
.slide-bg.demo-1 {
    background: linear-gradient(135deg,
        hsl(260, 60%, 8%) 0%,
        hsl(270, 70%, 15%) 40%,
        hsl(240, 80%, 20%) 100%);
}
.slide-bg.demo-2 {
    background: linear-gradient(135deg,
        hsl(200, 70%, 8%) 0%,
        hsl(220, 80%, 15%) 40%,
        hsl(260, 65%, 18%) 100%);
}
.slide-bg.demo-3 {
    background: linear-gradient(135deg,
        hsl(280, 60%, 8%) 0%,
        hsl(300, 50%, 15%) 30%,
        hsl(260, 70%, 22%) 100%);
}

/* Decorative glow for demo slides */
.slide-bg.demo-1::before,
.slide-bg.demo-2::before,
.slide-bg.demo-3::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.slide-bg.demo-1::before { background: radial-gradient(circle, #6c5ce7, #a29bfe); }
.slide-bg.demo-2::before { background: radial-gradient(circle, #00cec9, #6c5ce7); }
.slide-bg.demo-3::before { background: radial-gradient(circle, #fd79a8, #6c5ce7); }

/* ---- Dark Overlay Layer ---- */
.slide-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1;
}

/* ---- Content Layer ---- */
.slide-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 0 80px;
}

/* Text alignment variants */
.slide-content.align-center { justify-content: center; text-align: center; }
.slide-content.align-left   { justify-content: flex-start; text-align: left; }
.slide-content.align-right  { justify-content: flex-end; text-align: right; }

/* RTL default */
[dir="rtl"] .slide-content.align-right { justify-content: flex-start; text-align: right; }
[dir="rtl"] .slide-content.align-left  { justify-content: flex-end;   text-align: left; }

.slide-inner {
    background: transparent;
    max-width: 680px;
    width: 100%;
}

/* ---- Slide Badge ---- */
.slide-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(108, 92, 231, 0.25);
    border: 1px solid rgba(108, 92, 231, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #a29bfe;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 24px;

    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

.slide-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #6c5ce7;
    border-radius: 50%;
    animation: badgePulse 1.5s infinite;
    flex-shrink: 0;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(108,92,231,0.4); }
    50% { opacity: 0.8; transform: scale(1.15); box-shadow: 0 0 0 6px rgba(108,92,231,0); }
}

/* ---- Slide Title ---- */
.slide-title {
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.15;
    color: #ffffff;
    margin: 0 0 16px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);

    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.6s ease 0.25s, transform 0.6s ease 0.25s;
}

.slide-title .gradient-word {
    background: linear-gradient(135deg, #a29bfe, #00cec9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Slide Subtitle ---- */
.slide-subtitle {
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin: 0 0 14px;

    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease 0.35s, transform 0.6s ease 0.35s;
}

/* ---- Slide Description ---- */
.slide-description {
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    color: rgba(255,255,255,0.7);
    line-height: 1.75;
    margin: 0 0 36px;
    max-width: 520px;

    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s ease 0.45s, transform 0.6s ease 0.45s;
}

.slide-content.align-center .slide-description { margin-left: auto; margin-right: auto; }

/* ---- CTA Buttons ---- */
.slide-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;

    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.6s, transform 0.6s ease 0.6s;
}

.slide-content.align-center .slide-buttons { justify-content: center; }
[dir="rtl"] .slide-content.align-right .slide-buttons { justify-content: flex-start; }

.slide-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.slide-btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 40px rgba(108, 92, 231, 0.65);
    color: #fff;
}

.slide-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 30px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.slide-btn-secondary:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.14);
    border-color: rgba(108,92,231,0.5);
    color: #fff;
}

/* ---- Active state: reveal animations ---- */
.carousel-slide.active .slide-badge,
.carousel-slide.active .slide-title,
.carousel-slide.active .slide-subtitle,
.carousel-slide.active .slide-description,
.carousel-slide.active .slide-buttons {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Navigation Arrows ---- */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.carousel-arrow:hover {
    background: rgba(108, 92, 231, 0.35);
    border-color: rgba(108, 92, 231, 0.6);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev-arrow {
    right: 30px;
}

.carousel-arrow.next-arrow {
    left: 30px;
}

[dir="ltr"] .carousel-arrow.prev-arrow { right: auto; left: 30px; }
[dir="ltr"] .carousel-arrow.next-arrow { left: auto; right: 30px; }

/* ---- Pagination Dots ---- */
.carousel-dots {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}

.carousel-dot {
    height: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.35);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.4s ease,
                box-shadow 0.4s ease;
    width: 10px;
    position: relative;
    overflow: hidden;
}

.carousel-dot.active {
    width: 36px;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    box-shadow: 0 0 12px rgba(108,92,231,0.6);
}

/* Progress fill inside active dot */
.carousel-dot.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255,255,255,0.4);
    width: 0%;
    animation: dotProgress var(--carousel-interval, 5s) linear forwards;
    border-radius: 10px;
}

@keyframes dotProgress {
    from { width: 0%; }
    to   { width: 100%; }
}

/* ---- Slide Counter ---- */
.carousel-counter {
    position: absolute;
    bottom: 32px;
    right: 80px;
    z-index: 10;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    letter-spacing: 1px;
}

[dir="rtl"] .carousel-counter { right: auto; left: 80px; }

.carousel-counter .current { color: #ffffff; font-size: 1.1rem; }

/* ---- Loading skeleton (while fetching from API) ---- */
.carousel-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, hsl(260,60%,8%), hsl(270,70%,15%));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: opacity 0.5s ease;
}

.carousel-skeleton.hidden { opacity: 0; pointer-events: none; }

.skeleton-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.skeleton-logo-icon {
    font-size: 3rem;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.skeleton-bar {
    width: 160px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}

.skeleton-fill {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 4px;
    animation: skeletonLoad 1.5s ease-in-out infinite;
}

@keyframes skeletonLoad {
    0% { width: 0%; }
    60% { width: 90%; }
    100% { width: 100%; }
}

/* ---- Empty State ---- */
.carousel-empty {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-card, #12122a);
    z-index: 5;
}

.carousel-empty.show { display: flex; }

.carousel-empty-icon { font-size: 4rem; opacity: 0.4; }

.carousel-empty-text {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 1024px) {
    .hero-carousel { height: 620px; }
    .slide-content { padding: 0 50px; }
    .carousel-counter { right: 50px; }
    [dir="rtl"] .carousel-counter { left: 50px; }
}

@media (max-width: 768px) {
    .hero-carousel { height: 520px; }
    .slide-content { padding: 0 24px; }

    .slide-title { font-size: clamp(1.6rem, 6vw, 2.6rem); }
    .slide-description { font-size: 0.9rem; }

    .slide-btn-primary,
    .slide-btn-secondary { padding: 12px 22px; font-size: 0.9rem; }

    .carousel-arrow { width: 44px; height: 44px; font-size: 0.95rem; }
    .carousel-arrow.prev-arrow { right: 14px; }
    .carousel-arrow.next-arrow { left: 14px; }
    [dir="ltr"] .carousel-arrow.prev-arrow { right: auto; left: 14px; }
    [dir="ltr"] .carousel-arrow.next-arrow { left: auto; right: 14px; }

    .carousel-counter { display: none; }
    .slide-inner { max-width: 100%; }
}

@media (max-width: 480px) {
    .hero-carousel { height: 480px; }
    .slide-content { padding: 0 20px; align-items: center; justify-content: center; text-align: center; }
    .slide-inner { max-width: 100%; }
    .slide-buttons { justify-content: center; }
    .slide-description { margin-left: auto; margin-right: auto; }
    .slide-btn-primary, .slide-btn-secondary { padding: 11px 20px; font-size: 0.85rem; }
    .carousel-arrow { width: 38px; height: 38px; font-size: 0.85rem; }
    .carousel-arrow.prev-arrow { right: 8px; }
    .carousel-arrow.next-arrow { left: 8px; }
    [dir="ltr"] .carousel-arrow.prev-arrow { right: auto; left: 8px; }
    [dir="ltr"] .carousel-arrow.next-arrow { left: auto; right: 8px; }
}

/* ====================================================
   ACCESSIBILITY
   ==================================================== */
.carousel-arrow:focus-visible,
.carousel-dot:focus-visible {
    outline: 2px solid #6c5ce7;
    outline-offset: 3px;
}

/* Pause indicator (shown when autoplay paused) */
.carousel-paused-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.hero-carousel:hover .carousel-paused-indicator { opacity: 1; }


