/* Reset & Hide Scrollbars */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.bsv-container {
    position: relative;
    width: 100%;
    height: auto;
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    scrollbar-width: thin;
    -ms-overflow-style: auto;
}

/* إعادة تصميم شريط التمرير */
.bsv-container::-webkit-scrollbar {
    width: 10px;
    display: block !important;
}

.bsv-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.bsv-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.bsv-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Fullscreen Sections للشاشات الكبيرة */
.bsv-section {
    position: relative;
    width: 100%;
    height: 100vh; /* كل قسم يأخذ ارتفاع الشاشة بالكامل */
    scroll-snap-align: start;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    padding-bottom: 80px;
}

/* تعديل ارتفاع آخر section ليشمل padding-bottom */
.bsv-section:last-child {
    height: calc(100vh + 80px);
}

/* Fullscreen Background Image - COVER MODE */
.bsv-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    transition: transform 0.3s ease-out;
    z-index: 1;
    object-fit: cover;
}

/* توسيع خلفية الصورة في آخر section */
.bsv-section:last-child .bsv-bg-image {
    height: 100%;
}

/* Caption - Bottom Center - Show on Hover Only */
.bsv-caption {
    position: relative;
    z-index: 2;
    display: inline-block;
    white-space: nowrap;
    padding: 0.1em 0.3em;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: bold;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    background: rgba(55, 55, 55, 0.7) !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border-radius: 0 !important;
    transform: translateY(10px);
    margin-bottom: 40px;
    line-height: 1.2;
}

.bsv-section:hover .bsv-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design - Desktop Large (1200px+) */
@media (min-width: 1200px) {
    .bsv-caption {
        font-size: 32px !important;
        margin-bottom: 50px;
        padding: 0.15em 0.4em;
    }
}

/* Responsive Design - Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .bsv-caption {
        font-size: 28px !important;
        margin-bottom: 45px;
        padding: 0.12em 0.35em;
    }
}

/* Responsive Design - Tablet (768px - 991px) - عمود من خليتين */
@media (min-width: 768px) and (max-width: 991px) {
    .bsv-container {
        display: flex;
        flex-direction: column;
        scroll-snap-type: none; /* إزالة snap للموبايل والتابلت */
    }
    
    .bsv-section {
        height: 50vh !important; /* نصف ارتفاع الشاشة */
        min-height: 50vh;
        padding-bottom: 30px;
        scroll-snap-align: none;
    }
    
    .bsv-section:last-child {
        height: 50vh !important;
    }
    
    .bsv-caption {
        font-size: 20px !important;
        margin-bottom: 15px;
        padding: 0.08em 0.25em;
        white-space: normal;
        max-width: 90%;
        word-wrap: break-word;
    }
}

/* Responsive Design - Tablet Small (576px - 767px) - عمود من خليتين */
@media (min-width: 576px) and (max-width: 767px) {
    .bsv-container {
        display: flex;
        flex-direction: column;
        scroll-snap-type: none;
        height: auto;
    }
    
    .bsv-section {
        width: 100%;
        height: 50vh !important; /* نصف ارتفاع الشاشة */
        min-height: 50vh;
        padding-bottom: 25px;
        scroll-snap-align: none;
    }
    
    .bsv-section:last-child {
        height: 50vh !important;
    }
    
    .bsv-caption {
        font-size: 18px !important;
        margin-bottom: 12px;
        padding: 0.06em 0.2em;
        line-height: 1.1;
    }
}

/* Responsive Design - Mobile Large (480px - 575px) - عمود من 4 خلايا */
@media (min-width: 480px) and (max-width: 575px) {
    .bsv-container {
        display: flex;
        flex-direction: column;
        scroll-snap-type: none;
    }
    
    .bsv-section {
        height: 25vh !important; /* ربع ارتفاع الشاشة (4 خلايا) */
        min-height: 25vh;
        padding-bottom: 15px;
        scroll-snap-align: none;
    }
    
    .bsv-section:last-child {
        height: 25vh !important;
    }
    
    .bsv-caption {
        font-size: 14px !important;
        margin-bottom: 8px;
        padding: 0.05em 0.15em;
        line-height: 1;
    }
}

/* Responsive Design - Mobile Small (360px - 479px) - عمود من 4 خلايا */
@media (min-width: 360px) and (max-width: 479px) {
    .bsv-container {
        display: flex;
        flex-direction: column;
        scroll-snap-type: none;
    }
    
    .bsv-section {
        height: 25vh !important; /* ربع ارتفاع الشاشة (4 خلايا) */
        min-height: 25vh;
        padding-bottom: 12px;
        scroll-snap-align: none;
    }
    
    .bsv-section:last-child {
        height: 25vh !important;
    }
    
    .bsv-caption {
        font-size: 12px !important;
        margin-bottom: 6px;
        padding: 0.04em 0.12em;
    }
}

/* Responsive Design - Mobile Extra Small (أقل من 360px) - عمود من 4 خلايا */
@media (max-width: 359px) {
    .bsv-container {
        display: flex;
        flex-direction: column;
        scroll-snap-type: none;
    }
    
    .bsv-section {
        height: 25vh !important; /* ربع ارتفاع الشاشة (4 خلايا) */
        min-height: 25vh;
        padding-bottom: 10px;
        scroll-snap-align: none;
    }
    
    .bsv-section:last-child {
        height: 25vh !important;
    }
    
    .bsv-caption {
        font-size: 10px !important;
        margin-bottom: 5px;
        padding: 0.03em 0.1em;
    }
}

/* تحسينات للشاشات الطويلة */
@media (max-height: 600px) and (min-width: 768px) {
    .bsv-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .bsv-caption {
        font-size: 20px !important;
        margin-bottom: 20px;
    }
}

/* تحسينات للشاشات القصيرة */
@media (max-height: 400px) {
    .bsv-section {
        height: 100vh;
        min-height: 100vh;
        padding-bottom: 15px;
    }
    
    .bsv-caption {
        font-size: 16px !important;
        margin-bottom: 15px;
    }
}

/* إصلاح لحواف الصور على الجوانب */
.bsv-bg-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    z-index: 1;
}

/* التأكد من أن الصفحة كاملة العرض */
body {
    width: 100%;
    overflow-x: hidden;
}

/* إصلاح أي قص للصفحة */
* {
    box-sizing: border-box;
}

/* إظهار الفوتر بعد المحتوى */
.bsv-container + * {
    position: relative;
    z-index: 10;
}