:root {
    --item-width: 100px;
    --item-height: 150px;
    --image-gap: 120px;
    --baby-blue: #87ceeb;
}

.swiper-container {
    position: relative;
    width: 100%;
    height: 100vh; /* or 70vh / 55vh etc */
    overflow: hidden;
    background-color: #f5f5f5;
    overflow: hidden;
    transition: height 0.3s ease;
}

#slide {
    width: 100%;
    height: 100%;
    position: relative;
}

.item {
    width: var(--item-width);
    height: var(--item-height);
    background-position: center;
    background-size: 100% 100%; 
    background-repeat: no-repeat;
    display: inline-block;
    position: absolute;
    z-index: 1;
    top: 50%;
    transform: translate(50%, 100%);
    border-radius: 1rem;
    box-shadow: 0 30px 50px #505050;
    overflow: hidden;
    transition: 0.5s;
}

/* Fullscreen main images */
.item:nth-child(1),
.item:nth-child(2) {
    left: 0;
    top: 0;
    transform: translate(0, 0);
    border-radius: 0;
    width: 100%;
    height: 100%;
    box-shadow: none;
}

/* Overlay gradient - ONLY for main slides */
.item:nth-child(1)::before,
.item:nth-child(2)::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 30%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

/* Optional pattern overlay */
.item:nth-child(1)::after,
.item:nth-child(2)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url(../img/img-pattern.svg) no-repeat;
    background-size: 100% auto; /* Zoomed in slightly */
    background-position: center;
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

/* Stacked smaller images */
.item:nth-child(3) {
    left: calc(73% + 0 * var(--image-gap));
}

.item:nth-child(4) {
    left: calc(73% + 1 * var(--image-gap));
}

.item:nth-child(5) {
    left: calc(73% + 2 * var(--image-gap));
}

.item:nth-child(n+6) {
    left: calc(75% + 3 * var(--image-gap));
    opacity: 0;
}

/* Content overlay */
.item .content {
    position: absolute;
    top: 50%;
    left: 80px;
    transform: translateY(-50%);
    color: #fff;
    z-index: 3; /* Increased to be above gradient */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    display: none;
    max-width: 500px;
}

.item:nth-child(2) .content {
    display: block;
}

/* Content animation */
.item .name {
    font-size: 30px;
    font-weight: 700;
    opacity: 0;
    animation: showcontent 1s ease-in-out forwards;
    margin-bottom: 20px;
}
[dir=rtl] .item .name {
    font-size: 21px;
}
.item .des {
    margin: 20px 0;
    font-size: 18px;
    opacity: 0;
    animation: showcontent 1s ease-in-out 0.3s forwards;
    line-height: 1.6;
}

.item button {
    padding: 12px 24px;
    border: none;
    background-color: var(--primary);
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    opacity: 0;
    animation: showcontent 1s ease-in-out 0.6s forwards;
    transition: background 0.3s ease;
}

.item button:hover {
    background-color: var(--baby-blue);
}

@keyframes showcontent {
    from {
        opacity: 0;
        transform: translateY(100px);
        filter: blur(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Navigation buttons */
.buttons {
    position: absolute;
    bottom: 30px;
    z-index: 1;
    text-align: start;
    width: 100%;
    color: var(--secondary);
}

.buttons button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 0;
    transition: 0.5s;
    background: transparent;
    cursor: pointer;
    margin: 0 10px;
}

.buttons button i {
    color: #fff;
    font-size: 20px;
}

.buttons button:hover {
    background-color: var(--primary);
    color: #fff;
}

.down-shape {
    position: absolute;
    left: 50%;
    bottom: 10%;
    animation: top-bottom 5s infinite;
    z-index: 2;
}

@keyframes top-bottom {
    0% {
        transform: translateY(0) translateX(-50%);
    }

    100% {
        transform: translateY(50%) translateX(-50%);
        opacity: 0;
    }
}

/* RESPONSIVE DESIGN */

/* Ultra-Wide 4K+ Displays (3440px and above) */
@media (min-width: 3440px) {
    :root {
        --item-width: 150px;
        --item-height: 200px;
        --image-gap: 160px;
    }
    
    .item {
        transform: translate(50%, -5%);
    }
    
    .item .content {
        left: 150px;
        max-width: 700px;
    }
    
    .item .name {
        font-size: 52px;
    }
    
    .item .des {
        font-size: 22px;
    }
    
    .swiper-container {
        height: 50vh;
    }
}

/* 4K Ultra HD (2560px to 3439px) */
@media (min-width: 2560px) and (max-width: 3439px) {
    :root {
        --item-width: 130px;
        --item-height: 180px;
        --image-gap: 140px;
    }
    
    .item {
        transform: translate(50%, 100%);
    }
    
    .item .content {
        left: 120px;
        max-width: 600px;
    }
    
    .item .name {
        font-size: 48px;
    }
    
    .item .des {
        font-size: 20px;
    }
    
    .swiper-container {
        height: 55vh;
    }
}

/* Large desktops and 2K screens (1920px to 2559px) */
@media (min-width: 1920px) and (max-width: 2559px) {
    .item {
        transform: translate(50%, 50%);
    }
    
    .swiper-container {
        height: 55vh;
    }
}

/* Standard desktops (1440px to 1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
    .item {
        transform: translate(50%, 10%);
    }
    
    .swiper-container {
        height: 55vh;
    }
}

/* Laptops / small desktops (993px to 1439px) */
@media (min-width: 993px) and (max-width: 1439px) {
    .item {
        transform: translate(50%, 25%);
    }
    
    .swiper-container {
        height: 90vh;
    }
    
    .item .content {
        left: 60px;
        max-width: 450px;
    }
    
    .item .name {
        font-size: 36px;
    }
    
    .item .des {
        font-size: 16px;
    }
}

/* Tablets (768px to 992px) */
@media (max-width: 992px) and (min-width: 768px) {
    :root {
        --item-width: 108px;
        --item-height: 125px;
        --image-gap: 118px;
    }

    .item {
        transform: translate(50%, 60%);
    }

    .item:nth-child(3) {
        left: calc(55% + 0 * var(--image-gap));
    }

    .item:nth-child(4) {
        left: calc(55% + 1 * var(--image-gap));
    }

    .item:nth-child(5) {
        left: calc(55% + 2 * var(--image-gap));
    }

    .swiper-container {
        height: 70vh;
    }

    .item .content {
        left: 50px;
        max-width: 400px;
    }

    .item .name {
        font-size: 32px;
    }

    .item .des {
        font-size: 16px;
    }

    .buttons button {
        width: 45px;
        height: 45px;
    }
    
    .down-shape {
        display: none;
    }
    
    /* Adjust gradient for smaller screens */
    .item:nth-child(1)::before,
    .item:nth-child(2)::before {
        background: linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0) 80%);
    }
}

/* Large Mobile (601px to 767px) */
@media (max-width: 767px) and (min-width: 601px) {
    :root {
        --item-width: 100px;
        --item-height: 130px;
        --image-gap: 110px;
    }
    
    .item {
        transform: translate(65%, 80%);
    }
    
    .item:nth-child(3) {
        left: calc(45% + 0 * var(--image-gap));
    }
    .item:nth-child(4) {
        left: calc(45% + 1 * var(--image-gap));
    }
    .item:nth-child(5) {
        left: calc(45% + 2 * var(--image-gap));
    }

    .swiper-container {
        height: 65vh;
    }

    .item .content {
        left: 20px;
        right: 20px;
        width: calc(100% - 40px);
        max-width: none;
        padding: 20px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 1rem;
        backdrop-filter: blur(5px);
        transform: translateY(-50%);
    }

    .item .name {
        font-size: 28px;
    }

    .item .des {
        font-size: 14px;
        margin: 15px 0;
    }

    .item button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .buttons {
        bottom: 20px;
    }

    .buttons button {
        width: 40px;
        height: 40px;
        margin: 0 5px;
    }
    
    .buttons button i {
        font-size: 16px;
    }

    /* Adjust gradient for mobile */
    .item:nth-child(1)::before,
    .item:nth-child(2)::before {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 30%, rgba(0, 0, 0, 0) 70%);
    }
    
    /* Hide pattern on mobile for better performance */
    .item:nth-child(1)::after,
    .item:nth-child(2)::after {
        display: none;
    }
}

/* Medium Mobile (481px to 600px) */
@media (max-width: 600px) and (min-width: 481px) {
    :root {
        --item-width: 90px;
        --item-height: 120px;
        --image-gap: 100px;
    }
    
    .item {
        transform: translate(75%, 85%);
    }
    
    .item:nth-child(3) {
        left: calc(40% + 0 * var(--image-gap));
    }
    .item:nth-child(4) {
        left: calc(40% + 1 * var(--image-gap));
    }
    .item:nth-child(5) {
        left: calc(40% + 2 * var(--image-gap));
    }

    .swiper-container {
        height: 65vh;
    }

    .item .content {
        left: 15px;
        right: 15px;
        width: calc(100% - 30px);
        padding: 15px;
    }

    .item .name {
        font-size: 24px;
    }

    .item .des {
        font-size: 13px;
    }
    
    .item button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Small Mobile (401px to 480px) */
@media (max-width: 480px) and (min-width: 401px) {
    :root {
        --item-width: 80px;
        --item-height: 110px;
        --image-gap: 90px;
    }
    
    .item {
        transform: translate(85%, 90%);
    }
    
    .item:nth-child(3) {
        left: calc(35% + 0 * var(--image-gap));
    }
    .item:nth-child(4) {
        left: calc(35% + 1 * var(--image-gap));
    }
    .item:nth-child(5) {
        left: calc(35% + 2 * var(--image-gap));
    }

    .swiper-container {
        height: 60vh;
    }

    .item .content {
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        padding: 10px;
    }

    .item .name {
        font-size: 22px;
    }

    .item .des {
        font-size: 12px;
        margin: 10px 0;
    }
    
    .item button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Ultra-small screens (up to 400px) */
@media (max-width: 400px) {
    :root {
        --item-width: 70px;
        --item-height: 95px;
        --image-gap: 80px;
    }
    
    .item {
        transform: translate(90%, 95%);
    }
    
    .item:nth-child(3) {
        left: calc(30% + 0 * var(--image-gap));
    }
    .item:nth-child(4) {
        left: calc(30% + 1 * var(--image-gap));
    }
    .item:nth-child(5) {
        left: calc(30% + 2 * var(--image-gap));
    }

    .swiper-container {
        height: 55vh;
    }

    .item .content {
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        padding: 10px;
    }

    .item .name {
        font-size: 20px;
    }

    .item .des {
        font-size: 11px;
        margin: 8px 0;
    }
    
    .item button {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* High-DPI displays (Retina, 4K) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .item {
        box-shadow: 0 40px 70px rgba(80, 80, 80, 0.5);
    }
    
    .item .content {
        text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .buttons button {
        min-width: 60px;
        min-height: 60px;
    }
}

/* For Arabic/RTL content support */
[dir="rtl"] .buttons {
    text-align: end;
}
[dir="rtl"] .buttons button i{
    transform: rotate(180deg);
}
[dir="rtl"] .item:nth-child(1)::after,
[dir="rtl"] .item:nth-child(2)::after {
    background-position: left top;
}