﻿/* ===== السلايدر الرئيسي (slider-wrapper) ===== */
.slider-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 700px;
    max-height: 80vh;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    background-color: #1a1a1a;
    margin-top: 20px;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ===== الشرائح ===== */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

    .slide.active {
        opacity: 1;
        visibility: visible;
        transition-delay: 0.3s;
    }

    .slide:not(.active) {
        transition-delay: 0s;
    }

/* ===== تنسيق خلفية الصور ===== */
.slide-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
    position: relative;
}

/* ===== محتوى السلايدر ===== */
.slide .slide-content {
    position: absolute;
    top: 130px;
    max-width: 650px;
    color: #ffffff;
    z-index: 20;
}

/* تنسيق النص حسب اللغة */
html[dir="rtl"] .slide .slide-content {
    right: 60px;
    left: auto;
    text-align: right;
}

html[dir="ltr"] .slide .slide-content {
    left: 60px;
    right: auto;
    text-align: left;
}

/* ===== تنسيق العناوين ===== */
.slide-content h2,
.slide-content h3,
.slide-content h4,
.slide-content h5 {
    font-family: "PT Bold Heading", 'Cairo', sans-serif !important;
    margin: 10px 0;
    padding: 5px 0;
    text-shadow: 0.1px 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    border-radius: 8px;
    display: inline-block;
    width: auto;
}

html[dir="rtl"] .slide-content h2,
html[dir="rtl"] .slide-content h3,
html[dir="rtl"] .slide-content h4,
html[dir="rtl"] .slide-content h5 {
    text-align: right;
}

html[dir="ltr"] .slide-content h2,
html[dir="ltr"] .slide-content h3,
html[dir="ltr"] .slide-content h4,
html[dir="ltr"] .slide-content h5 {
    text-align: left;
}

.slide-content h2 {
    color: #2b2b2b;
    font-size: 30px;
    font-weight: 800;
}

    .slide-content h2:first-of-type {
        font-size: 24px;
        opacity: 0.9;
    }

    .slide-content h2:last-of-type {
        font-size: 34px;
        font-weight: 700;
    }

.slide-content h3 {
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

html[dir="rtl"] .slide-content h3 {
    margin-left: 20px;
    margin-right: 0;
    right: 30px;
    left: auto;
}

html[dir="ltr"] .slide-content h3 {
    margin-left: 0;
    margin-right: 20px;
    right: auto;
    left: 30px;
}

.slide-content h3:first-of-type {
    font-size: 29px;
    opacity: 0.9;
}

.slide-content h3:last-of-type {
    font-size: 34px;
    font-weight: 700;
}

.slide-content h4 {
    font-size: 60px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffc300;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
    margin: 0 0 20px 0;
    max-width: 900px;
    position: relative;
    z-index: 3;
    white-space: normal;
    word-wrap: break-word;
}

html[dir="rtl"] .slide-content h4 {
    transform: translate3d(-45px, 0, 0);
}

html[dir="ltr"] .slide-content h4 {
    transform: translate3d(45px, 0, 0);
}

.slide-content h4:first-of-type {
    font-size: 24px;
    opacity: 0.9;
}

.slide-content h4:last-of-type {
    font-size: 38px;
    font-weight: 900;
}

.slide-content h5 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffc300;
    text-shadow: 0.5px 1px 2px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
    margin: 0 0 20px 0;
    max-width: 900px;
    position: relative;
    z-index: 3;
    white-space: normal;
    word-wrap: break-word;
}

html[dir="rtl"] .slide-content h5 {
    transform: translate3d(-45px, 0, 0);
}

html[dir="ltr"] .slide-content h5 {
    transform: translate3d(45px, 0, 0);
}

.slide-content h5:first-of-type {
    font-size: 24px;
    opacity: 0.9;
}

.slide-content h5:last-of-type {
    font-size: 38px;
    font-weight: 900;
}

/* ===== حركة دخول النص ===== */
.slide.active .slide-content h2,
.slide.active .slide-content h3,
.slide.active .slide-content h4,
.slide.active .slide-content h5 {
    animation-name: slideInUp;
    animation-duration: 1s;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-fill-mode: both;
    opacity: 0;
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide.active .slide-content h2:first-of-type,
.slide.active .slide-content h3:first-of-type,
.slide.active .slide-content h4:first-of-type,
.slide.active .slide-content h5:first-of-type {
    animation-delay: 0.2s;
}

.slide.active .slide-content h2:last-of-type,
.slide.active .slide-content h3:last-of-type,
.slide.active .slide-content h4:last-of-type,
.slide.active .slide-content h5:last-of-type {
    animation-delay: 0.5s;
}

/* ===== تنسيق الفيديو ===== */
.video-slide {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    display: block;
}

video.bg-video {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.video-slide .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,20,40,0.7) 0%, rgba(0,50,80,0.6) 100%);
    z-index: 2;
}

.video-slide .slide-content {
    position: absolute;
    top: 130px;
    z-index: 3;
}

html[dir="rtl"] .video-slide .slide-content {
    right: 60px;
    left: auto;
    text-align: right;
}

html[dir="ltr"] .video-slide .slide-content {
    right: auto;
    left: 60px;
    text-align: left;
}

/* ===== أزرار التحكم بالفيديو ===== */
.video-controls {
    position: absolute;
    bottom: 20px;
    z-index: 4;
}

html[dir="rtl"] .video-controls {
    right: 20px;
    left: auto;
}

html[dir="ltr"] .video-controls {
    right: auto;
    left: 20px;
}

.video-mute-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .video-mute-btn:hover {
        background-color: rgb(154, 15, 15);
        border-color: rgb(154, 15, 15);
    }

/* ===== أزرار التنقل ===== */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 30;
    backdrop-filter: blur(5px);
}

    .slider-arrow:hover {
        background-color: rgb(154, 15, 15);
        border-color: rgb(154, 15, 15);
        box-shadow: 0 0 20px rgba(154, 15, 15, 0.5);
    }

html[dir="rtl"] .prev-arrow {
    right: 20px;
    left: auto;
}

html[dir="rtl"] .next-arrow {
    left: 20px;
    right: auto;
}

html[dir="ltr"] .prev-arrow {
    left: 20px;
    right: auto;
}

html[dir="ltr"] .next-arrow {
    right: 20px;
    left: auto;
}

/* ===== نقاط الترقيم ===== */
.slider-dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 30;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .dot.active {
        background-color: rgb(154, 15, 15);
        transform: scale(1.2);
        box-shadow: 0 0 15px rgb(154, 15, 15);
    }

    .dot:hover {
        background-color: rgba(255, 255, 255, 0.8);
    }

/* ===== تحسينات للشاشات الكبيرة ===== */
@media (min-width: 1200px) {
    .slider-wrapper {
        height: 70vh;
    }
}

/* ===== الشاشات المتوسطة ===== */
@media (min-width: 768px) and (max-width: 1199px) {
    .slide .slide-content {
        top: 100px;
        max-width: 500px;
    }

    html[dir="rtl"] .slide .slide-content {
        right: 40px;
    }

    html[dir="ltr"] .slide .slide-content {
        left: 40px;
    }

    .slide-content h4 {
        font-size: 48px;
    }

    .slide-content h5 {
        font-size: 40px;
    }

    .slide-content h3 {
        font-size: 28px;
    }
}

/* ===== الشاشات الصغيرة ===== */
@media (max-width: 767px) {
    .slider-wrapper {
        height: 300px !important;
        min-height: 250px !important;
        max-height: 350px !important;
        border-radius: 15px;
        overflow: hidden;
    }

    .slider-container,
    .slide,
    .slide-bg,
    .video-slide {
        height: 100% !important;
        min-height: 250px !important;
    }

        .video-slide .bg-video,
        .bg-video {
            display: block !important;
            width: 100% !important;
            height: 100% !important;
            min-height: 250px !important;
            object-fit: cover !important;
            position: absolute !important;
            top: 0 !important;
            left: 0 !important;
        }

    .slide-bg {
        background-size: cover !important;
        background-position: center !important;
        height: 100% !important;
    }

    .slide .slide-content {
        top: 30px !important;
        max-width: 100%;
    }

    html[dir="rtl"] .slide .slide-content,
    html[dir="rtl"] .video-slide .slide-content {
        right: 15px !important;
        left: 15px !important;
        text-align: right !important;
    }

    html[dir="ltr"] .slide .slide-content,
    html[dir="ltr"] .video-slide .slide-content {
        left: 15px !important;
        right: 15px !important;
        text-align: left !important;
    }

    .slide-content h2 {
        font-size: 14px !important;
        margin: 2px 0;
    }

        .slide-content h2:first-of-type {
            font-size: 12px !important;
        }

        .slide-content h2:last-of-type {
            font-size: 16px !important;
        }

    .slide-content h3 {
        font-size: 16px !important;
    }

    html[dir="rtl"] .slide-content h3 {
        right: 5px !important;
        margin-left: 5px !important;
    }

    html[dir="ltr"] .slide-content h3 {
        left: 5px !important;
        margin-right: 5px !important;
    }

    .slide-content h3:first-of-type {
        font-size: 12px !important;
    }

    .slide-content h3:last-of-type {
        font-size: 14px !important;
    }

    .slide-content h4 {
        font-size: 18px !important;
        margin-bottom: 5px;
    }

    html[dir="rtl"] .slide-content h4 {
        transform: translate3d(-5px, 0, 0) !important;
    }

    html[dir="ltr"] .slide-content h4 {
        transform: translate3d(5px, 0, 0) !important;
    }

    .slide-content h4:first-of-type {
        font-size: 12px !important;
    }

    .slide-content h4:last-of-type {
        font-size: 14px !important;
    }

    .slide-content h5 {
        font-size: 16px !important;
        margin-bottom: 5px;
    }

    html[dir="rtl"] .slide-content h5 {
        transform: translate3d(-5px, 0, 0) !important;
    }

    html[dir="ltr"] .slide-content h5 {
        transform: translate3d(5px, 0, 0) !important;
    }

    .slide-content h5:first-of-type {
        font-size: 12px !important;
    }

    .slide-content h5:last-of-type {
        font-size: 14px !important;
    }

    .slider-arrow {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
    }

    html[dir="rtl"] .prev-arrow {
        right: 10px !important;
    }

    html[dir="rtl"] .next-arrow {
        left: 10px !important;
    }

    html[dir="ltr"] .prev-arrow {
        left: 10px !important;
    }

    html[dir="ltr"] .next-arrow {
        right: 10px !important;
    }

    .slider-dots {
        bottom: 10px !important;
        gap: 5px !important;
    }

    .dot {
        width: 8px !important;
        height: 8px !important;
    }

    .video-controls {
        bottom: 10px !important;
    }

    html[dir="rtl"] .video-controls {
        right: 10px !important;
    }

    html[dir="ltr"] .video-controls {
        left: 10px !important;
    }

    .video-mute-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
    }
}

/* ===== شاشات صغيرة جداً ===== */
@media (max-width: 480px) {
    .slider-wrapper {
        height: 250px !important;
        min-height: 200px !important;
        max-height: 280px !important;
    }

    .video-slide .bg-video,
    .bg-video {
        height: 250px !important;
        min-height: 200px !important;
    }

    .slide .slide-content {
        top: 20px !important;
    }

    .slide-content h2 {
        font-size: 14px !important;
    }

        .slide-content h2:last-of-type {
            font-size: 16px !important;
        }

    .slide-content h3 {
        font-size: 14px !important;
    }

        .slide-content h3:last-of-type {
            font-size: 14px !important;
        }

    .slide-content h4 {
        font-size: 16px !important;
    }

        .slide-content h4:last-of-type {
            font-size: 15px !important;
        }

    .slide-content h5 {
        font-size: 15px !important;
    }

        .slide-content h5:last-of-type {
            font-size: 14px !important;
        }
}

/* ===== شاشات صغيرة جداً جداً ===== */
@media (max-width: 360px) {
    .slider-wrapper {
        height: 200px !important;
        min-height: 180px !important;
    }

    .video-slide .bg-video,
    .bg-video {
        height: 200px !important;
        min-height: 180px !important;
    }

    .slide .slide-content {
        top: 15px !important;
    }

    .slide-content h2 {
        font-size: 12px !important;
    }

        .slide-content h2:last-of-type {
            font-size: 14px !important;
        }

    .slide-content h3 {
        font-size: 12px !important;
    }

        .slide-content h3:last-of-type {
            font-size: 12px !important;
        }

    .slide-content h4 {
        font-size: 14px !important;
    }

        .slide-content h4:last-of-type {
            font-size: 13px !important;
        }

    .slide-content h5 {
        font-size: 13px !important;
    }

        .slide-content h5:last-of-type {
            font-size: 12px !important;
        }
}

/* ===== دعم المتصفحات القديمة ===== */
@supports not (backdrop-filter: blur(5px)) {
    .slider-arrow {
        background-color: rgba(0, 0, 0, 0.5);
    }
}
