@import url(tokens.css);

/* --- Carousel Container --- */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    background: linear-gradient(135deg, var(--light-blue-gradient-end) 0%, var(--light-blue-gradient-start) 100%);
    border-radius: var(--border-radius-3xl);
    overflow: hidden;
    box-sizing: border-box;
    margin: 128px auto 0 auto;
}

/* --- Carousel Tabs (Top Navigation) --- */
.carousel-tabs {
    display: flex;
    gap: 24px;
    position: absolute;
    z-index: 20;
    left: 70px;
    top: 32px;
}

.tab-button {
    background: none;
    border: none;
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 0;
    position: relative;
    transition: color 0.3s ease;
}

.tab-button::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 3px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.tab-button.active {
    color: var(--text-dark);
}

.tab-button.active::after {
    width: 100%;
}

/* --- Carousel Slides --- */
.carousel-slides {
    position: relative;
    height: 520px;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    z-index: 5;
    transition: opacity 0.5s ease-in-out, z-index 0.01s linear 0.5s;
    padding: 0 24px;
    box-sizing: border-box;

    /* Desktop Background Settings */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: right bottom;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
    transition: opacity 0.5s ease-in-out;
}

/* --- DESKTOP IMAGES (Backgrounds) --- */
.slide-1 {
    background-image: url('../images/banner1@2x.jpg');
}

.slide-2 {
    background-image: url('../images/banner2@2x.jpg');
}

.slide-3 {
    background-image: url('../images/banner3@2x.jpg');
}

.slide-4 {
    background-image: url('../images/banner4@2x.jpg');
}

/* --- MOBILE IMAGE TAG (Hidden on Desktop) --- */
.mobile-image {
    display: none;
}

/* Slide Content */
.slide-content {
    width: 50%;
    max-width: 580px;
    padding-left: 48px;
    z-index: 10;
}

.slide-headline {
    font-size: var(--font-size-3xl);
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.2;
}

.slide-description {
    font-size: var(--font-size-md);
    font-weight: 300;
    color: var(--color-text-secondary-blue);
    line-height: 1.6;
    margin-bottom: 32px;
}

.slide-button {
    max-width: 184px;
    padding: 16px 24px;
    font-size: var(--font-size-base);
}

.slide-button:hover {
    background-color: #14406A;
}

/* --- Carousel Dots (Bottom Navigation) --- */
.carousel-dots {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    z-index: 20;
    pointer-events: none;
}

.dot-button {
    width: 8px;
    height: 8px;
    background-color: var(--color-disabled);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    margin: 0;
    pointer-events: auto;
}

.dot-button.active {
    background-color: var(--color-primary);
    opacity: 1;
    width: 32px;
    border-radius: var(--border-radius-xs);
}

/* --- Arrow Navigation (Hidden on Desktop) --- */
.carousel-arrow {
    display: none;
    position: absolute;
    /* Position relative to the container */
    top: 25%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--primary-blue);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-circle);
    font-size: var(--font-size-xl);
    cursor: pointer;
    z-index: 30;
    /* Higher than content and images */
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.carousel-arrow:hover {
    background-color: #fff;
}

.arrow-prev {
    left: 8px;
}

.arrow-next {
    right: 8px;
}

/* --- RESPONSIVE / MOBILE DESIGN --- */

@media (max-width: 992px) {
    .carousel-container {
        padding: 0;
        width: 95%;
        border-radius: 0;
        width: 95%;
        border-radius: 0;
        background: none;
    }

    /* Hide Tabs */
    .carousel-tabs {
        display: none;
    }

    /* Show Arrows */
    .carousel-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .carousel-slides {
        position: relative;
        height: auto;
        max-height: none;
        overflow: hidden;
    }

    .carousel-slide {
        flex-direction: column;
        text-align: center;
        padding: 0;

        /* REMOVE BACKGROUND IMAGE ON MOBILE */
        background-image: none !important;
        background: #fff;

        /* Flex setup for top image / bottom content */
        justify-content: flex-start;

        position: absolute;
        inset: 0;
        z-index: 1;
        display: flex;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.35s ease;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        transform: translateZ(0);
    }

    .carousel-slide.active {
        position: relative;
        z-index: 2;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* DISPLAY MOBILE IMAGE TAG */
    .mobile-image {
        display: block;
        width: 100%;
        height: 300px !important;
        min-height: 300px;
        max-height: 300px;
        object-fit: cover;
        /* Crop image nicely */
        border-radius: var(--border-radius-xl);
        -webkit-user-drag: none;
    }

    .slide-content {
        max-width: 100%;
        width: 100%;
        padding: 24px 24px 48px 24px;
        margin-top: 36px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        position: relative;
        z-index: 30;
    }

    .slide-headline {
        font-size: var(--font-size-2xl);
        margin: 0 auto;
    }

    .slide-description {
        font-size: var(--font-size-md);
        margin-bottom: 24px;
    }

    .carousel-dots {
        top: 316px;
        bottom: auto;
    }

    .dot-button {
        background-color: #ddd;
    }

    .dot-button.active {
        background-color: var(--color-primary);
    }
}

@media (max-width: 600px) {
    .slide-button {
        max-width: 320px;
        padding: 18px 32px;
        font-size: var(--font-size-md);
    }

    .carousel-slides {
        max-height: none;
        overflow: unset;
    }

    .carousel-arrow {
        top: 22%;
    }

    .carousel-dots {
        top: 316px;
    }



    .slide-headline {
        font-size: var(--font-size-xl);
    }
}