/* =============================================
   SYCAC Hero Slider — assets/css/slider.css
   ============================================= */

/* ── Zoom keyframe ── */
@keyframes slideZoom {
    from { transform: scale(1.0); }
    to   { transform: scale(1.08); }
}

/* ── Keyframes ── */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Slider container ── */
.hero-slider {
    position: relative;
    width: 100%;
    min-height: 85vh;
    overflow: hidden;
    padding-top: 96px;
    background: #1D3557;
}

/* ── Individual slide ── */
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 1;
    overflow: hidden;
    transition: opacity 0.8s ease;
    background-color: #1D3557;
    display: flex;
    align-items: center;
}
.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

/* ── Background image layer (separate from content for zoom isolation) ── */
.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1);
    will-change: transform;
}

/* Zoom animation when slide is active */
.hero-slide.active .slide-bg {
    animation: slideZoom 7s ease-out both;
}

/* Reset zoom when slide is inactive so next activation starts fresh */
.hero-slide:not(.active) .slide-bg {
    animation: none;
    transform: scale(1);
}

/* ── Overlay (same gradient as static hero) ── */
.hero-slide .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(28, 53, 87, 0.80) 0%,
        rgba(28, 53, 87, 0.50) 45%,
        transparent 75%
    );
    z-index: 0;
}
.hero-slide .hero-overlay-rtl {
    background: linear-gradient(
        to left,
        rgba(28, 53, 87, 0.80) 0%,
        rgba(28, 53, 87, 0.50) 45%,
        transparent 75%
    );
}

/* ── Slide content ── */
.hero-slide .hero-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    padding: 60px 100px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/*
 * RTL FIX — في flex-direction:column مع direction:rtl:
 *   flex-start  = يمين  ✓  (هذا ما نريد)
 *   flex-end    = يسار  ✗  (هذا كان الخطأ السابق)
 */
.hero-slide .hero-content-rtl {
    direction: rtl;
    align-items: flex-start;   /* في RTL column → flex-start = يمين */
    text-align: right;
    margin-left: auto;
    margin-right: 0;
    padding: 60px 100px 60px 64px;
}

.hero-slide .hero-content-rtl .hero-badge,
.hero-slide .hero-content-rtl .hero-title,
.hero-slide .hero-content-rtl .hero-subtitle,
.hero-slide .hero-content-rtl .hero-buttons {
    text-align: right;
    align-self: flex-start;    /* في RTL column → flex-start = يمين */
}

.hero-slide .hero-content-rtl .hero-buttons {
    justify-content: flex-start; /* في RTL row → flex-start = يمين */
}

/* ── Content: hidden by default, animated when slide is active ── */
.hero-slide .hero-badge,
.hero-slide .hero-title,
.hero-slide .hero-subtitle,
.hero-slide .hero-buttons {
    opacity: 0;
    animation: none;
}

/* ── Content animations (triggered when slide becomes active) ── */
.hero-slide.active .hero-badge    { animation: fadeInDown 0.5s ease 0.4s both; }
.hero-slide.active .hero-title    { animation: fadeInUp   0.6s ease 0.6s both; }
.hero-slide.active .hero-subtitle { animation: fadeInUp   0.6s ease 0.8s both; }
.hero-slide.active .hero-buttons  { animation: fadeInUp   0.5s ease 1.0s both; }

/* Badge */
.hero-slide .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(60, 120, 180, 0.3);
    border: 1px solid rgba(60, 120, 180, 0.5);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 5px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

/* Title */
.hero-slide .hero-title {
    font-size: clamp(32px, 4vw, 54px);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

/* Subtitle */
.hero-slide .hero-subtitle {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 540px;
}

/* ── Arrow controls ── */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(4px);
}
.slider-arrow:hover { background: rgba(255, 255, 255, 0.35); transform: translateY(-50%) scale(1.05); }
.slider-arrow:focus-visible { outline: 2px solid rgba(255,255,255,0.8); outline-offset: 2px; }

.slider-arrow-prev { left: 24px; }
.slider-arrow-next { right: 24px; }

/* RTL: mirror arrow positions */
[dir="rtl"] .slider-arrow-prev { left: auto; right: 24px; }
[dir="rtl"] .slider-arrow-next { right: auto; left: 24px; }
[dir="rtl"] .slider-arrow-prev svg { transform: scaleX(-1); }
[dir="rtl"] .slider-arrow-next svg { transform: scaleX(-1); }

/* ── Dot navigation ── */
.slider-dots {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}
.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}
.slider-dot.active {
    background: #fff;
    width: 24px;
}

/* ── Slide counter ── */
.slider-counter {
    position: absolute;
    bottom: 32px;
    right: 28px;
    z-index: 10;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
}
[dir="rtl"] .slider-counter { right: auto; left: 28px; }

/* ── Scroll indicator (inherited from static hero) ── */
.hero-slider .hero-scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* ── Single-slide: hide arrows/dots/counter ── */
.hero-slider.single-slide .slider-arrow,
.hero-slider.single-slide .slider-dots,
.hero-slider.single-slide .slider-counter { display: none !important; }

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

/* ── Portrait Mobile ── */
@media (max-width: 1024px) and (orientation: portrait) {
    .hero-slider {
        min-height: unset !important;
        height: auto !important;
        padding: 0 !important;
    }
    .hero-slide {
        position: relative !important;
        height: 75svh !important;
        min-height: unset !important;
        inset: auto !important;
        opacity: 1 !important;
        display: none !important;
        flex-direction: column;
        justify-content: center;
    }
    .hero-slide.active {
        display: flex !important;
    }
    .hero-slide .hero-overlay {
        position: absolute !important;
        inset: 0 !important;
        background: linear-gradient(
            to top,
            rgba(10, 20, 40, 0.90) 0%,
            rgba(10, 20, 40, 0.60) 45%,
            rgba(10, 20, 40, 0.10) 80%,
            transparent 100%
        ) !important;
    }
    .hero-slide .hero-content,
    .hero-slide .hero-content-rtl {
        position: relative !important;
        z-index: 2 !important;
        text-align: center !important;
        padding: 20px 20px 40px !important;
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin: 0 !important;
    }
    .hero-slide .hero-title {
        font-size: clamp(24px, 7vw, 36px) !important;
        white-space: normal !important;
        color: #ffffff !important;
    }
    .hero-slide .hero-subtitle {
        font-size: 15px !important;
        text-align: center !important;
        color: rgba(255,255,255,0.88) !important;
    }
    .hero-slide .hero-badge {
        background: rgba(255,255,255,0.15) !important;
        border-color: rgba(255,255,255,0.3) !important;
        color: #ffffff !important;
    }
    .hero-slide .hero-buttons { justify-content: center !important; }
    .hero-slide .hero-buttons .btn {
        flex: 0 0 auto !important;
        padding: 11px 28px !important;
        font-size: 14px !important;
    }

    /* RTL: override per-child align-self and text-align so centering takes effect */
    .hero-slide .hero-content-rtl .hero-badge,
    .hero-slide .hero-content-rtl .hero-title,
    .hero-slide .hero-content-rtl .hero-subtitle,
    .hero-slide .hero-content-rtl .hero-buttons {
        align-self: center !important;
        text-align: center !important;
    }

    .slider-arrow  { display: none !important; }
    .slider-dots   { bottom: 24px !important; gap: 6px !important; }
    .slider-counter { display: none !important; }
}

/* =============================================
   SLIDE THEME: default (dark background → white text)
   ============================================= */
.hero-slide .hero-title,
.hero-slide .hero-subtitle { color: #ffffff; }

.hero-slide .hero-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.hero-slide .btn-primary {
    background: #3C78B4;
    color: #ffffff;
}

.hero-slide .btn-outline {
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
}

/* ── Light background theme ── */
.hero-slide.slide-theme-light .hero-title { color: #1D3557; }
.hero-slide.slide-theme-light .hero-subtitle { color: #374151; }
.hero-slide.slide-theme-light .hero-badge {
    background: rgba(60, 120, 180, 0.12);
    border: 1px solid rgba(60, 120, 180, 0.25);
    color: #3C78B4;
}
.hero-slide.slide-theme-light .btn-primary {
    background: #3C78B4;
    color: #ffffff;
}
.hero-slide.slide-theme-light .btn-outline {
    border-color: #3C78B4;
    color: #3C78B4;
}
.hero-slide.slide-theme-light .slider-arrow {
    background: rgba(29, 53, 87, 0.15);
    border-color: rgba(29, 53, 87, 0.3);
    color: #1D3557;
}

/* ── Dark background theme (explicit) ── */
.hero-slide.slide-theme-dark .hero-title { color: #ffffff; }
.hero-slide.slide-theme-dark .hero-subtitle { color: rgba(255, 255, 255, 0.88); }
.hero-slide.slide-theme-dark .hero-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* Optional per-element typography selected in the slide settings */
.hero-slide.has-custom-title-color .hero-title { color: var(--slide-title-color); }
.hero-slide.has-custom-title-size .hero-title { font-size: var(--slide-title-size); }
.hero-slide.has-custom-subtitle-color .hero-subtitle { color: var(--slide-subtitle-color); }
.hero-slide.has-custom-subtitle-size .hero-subtitle { font-size: var(--slide-subtitle-size); }
.hero-slide.has-custom-badge-color .hero-badge { color: var(--slide-badge-color); }
.hero-slide.has-custom-badge-size .hero-badge { font-size: var(--slide-badge-size); }

/* Header nav theme → see header.css (.header-on-dark / .header-on-light) */

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

/* ── Landscape Mobile ── */
@media (max-width: 1024px) and (orientation: landscape) {
    .hero-slider {
        min-height: unset;
        height: auto;
        padding-top: 60px;
        padding-bottom: 40px;
    }
    .hero-slide {
        position: relative;
        min-height: 100svh;
        inset: auto;
        opacity: 1 !important;
        display: none;
    }
    .hero-slide.active { display: flex; }
    .hero-slide .hero-content {
        padding: 40px 80px;
    }
    .hero-slide .hero-title {
        font-size: clamp(22px, 4vw, 32px);
    }
    .hero-slide .hero-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    .slider-arrow {
        display: flex !important;
        width: 36px;
        height: 36px;
    }
    .slider-dots { bottom: 12px; }
}
