/* Case Studies Section Refonte */
.refonte-case-studies {
    width: 100%;
    padding: 80px 64px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

.case-studies-header {
    margin-bottom: 64px;
    text-align: center;
}

.case-studies-title {
    font-family: var(--font-primary);
    font-size: 48px;
    font-weight: 500;
    color: #003329;
    margin: 0;
}

.case-studies-title .highlight {
    color: #EC674E;
}

/* Container */
.case-studies-container {
    width: 100%;
    margin-bottom: 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Main Display Area */
.case-study-main {
    width: 100%;
    position: relative;
}

/* Card - Now hidden by default, shown when active */
.case-study-card {
    width: 100%;
    display: none;
    /* Hidden by default */
    background: #FFFAF9;
    border-radius: 24px;
    overflow: hidden;
    padding: 24px;
    gap: 24px;
    box-sizing: border-box;
    flex-direction: row;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.case-study-card.active {
    display: flex;
    opacity: 1;
}

/* Left Media */
.card-media {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.media-tag {
    position: absolute;
    top: 24px;
    left: 24px;
    background: #FCEBE8;
    color: #EC674E;
    padding: 8px 16px;
    border-radius: 100px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    z-index: 2;
}

.media-wrapper {
    width: 100%;
    /* Keep aspect ratio block inside media wrapper. 
       min-height is moved to wrapper instead of card-media */
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

.media-wrapper img.case-image,
.media-wrapper video.case-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Play Button */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    z-index: 3;
    transition: transform 0.2s ease;
    padding: 0;
}

.play-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.play-button img {
    width: 64px;
    height: 64px;
    margin: 0;
}

/* Right Content */
.card-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
}

.company-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-bottom: 48px;
}

.quote-block {
    border-left: 4px solid #EC674E;
    padding-left: 24px;
    margin-bottom: 24px;
}

.quote-text {
    font-family: var(--font-primary);
    font-size: 20px;
    line-height: 1.4;
    font-style: italic;
    color: #181D27;
    margin: 0;
    font-weight: 400;
}

.author-block {
    font-family: var(--font-primary);
    font-size: 16px;
    color: #475467;
    margin-bottom: 24px;
}

.author-name {
    font-weight: 600;
    color: #181D27;
}

.kpis-row {
    display: flex;
    gap: 32px;
    width: 100%;
    margin-top: 16px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.kpi-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-value {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 500;
    color: #181D27;
}

.kpi-desc {
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.4;
    color: #475467;
}

/* Thumbnails */
.case-studies-thumbnails {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    /* Space for scrollbar if needed */
}

.thumbnail-item {
    width: 160px;
    height: 90px;
    /* 16:9 approx */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.thumbnail-item.active {
    border-color: #EC674E;
    transform: translateY(-4px);
}

.thumbnail-item:hover {
    transform: translateY(-2px);
}

.thumbnail-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.thumbnail-item.active .thumbnail-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.thumbnail-logo {
    max-width: 80%;
    max-height: 60%;
    object-fit: contain;
}

/* CTA */
.case-studies-cta {
    margin-top: 32px;
    display: none;
}

.secondaryButton {
    display: flex;
    padding: 4px 4px 4px 16px;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border-radius: 91.087px;
    background: var(--Gray, #EFF3F2);
    background-color: #EFF3F2;
    color: #181D27;
    font-family: var(--font-primary);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.secondaryButton:hover {
    background-color: #E4E7E6;
}

.secondaryButton img {
    width: 32px;
    height: 32px;
}

/* Horizontal Text Testimonials */
.testimonials-text-carousel {
    width: 100%;
    margin-bottom: 48px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.testimonials-text-carousel::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.testimonials-track {
    display: flex;
    gap: 24px;
    padding-bottom: 16px;
    /* Allow cards to have some space */
}

.testimonial-text-card {
    min-width: 400px;
    max-width: 400px;
    background: #FFFAF9;
    border-radius: 20px;
    padding: 32px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
}

.quote-line {
    border-left: 2px solid #EC674E;
    padding-left: 24px;
}

.quote-italic {
    font-size: 16px;
    line-height: 1.5;
    font-style: italic;
    color: #181D27;
    margin: 0;
    font-weight: 400;
}

.testimonial-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #FCEBE8;
    /* Light orange background underneath */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.generic-avatar {
    width: 24px !important;
    height: 24px !important;
    opacity: 0.5;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-size: 16px;
    font-weight: 500;
    color: #181D27;
}

.author-role {
    font-size: 14px;
    color: #475467;
}

.company-logo {
    max-width: 80px;
    max-height: 32px;
    object-fit: contain;
}

/* Bottom CTA container with Nav */
.case-studies-cta-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
}

.cta-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.btn-rounded-dark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #E2E8E6;
    /* Light gray green from image */
    color: #003329;
    padding: 8px 8px 8px 24px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: transform 0.2s ease;
}

.btn-rounded-dark:hover {
    transform: translateY(-2px);
}

.btn-rounded-dark img {
    background: #003329;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
}

.carousel-nav {
    display: flex;
    gap: 12px;
    position: absolute;
    right: 0;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #003329;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 8px;
    box-sizing: border-box;
}

.nav-btn:hover {
    transform: scale(1.05);
}


/* Responsive */
@media (max-width: 1024px) {
    .refonte-case-studies {
        padding: 48px 24px;
    }

    .case-studies-title {
        font-size: 32px;
        text-align: center;
        line-height: 1.2;
    }

    /* Adjust Card for Mobile */
    .case-study-card {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .card-media {
        min-height: 250px;
        border-radius: 12px;
    }

    .media-tag {
        top: 16px;
        left: 16px;
        font-size: 12px;
        padding: 6px 12px;
    }

    .card-content {
        padding: 16px 8px;
        gap: 24px;
    }

    .company-logo-img {
        height: 32px;
        margin-bottom: 24px;
    }

    .quote-text {
        font-size: 18px;
    }

    .quote-block {
        margin-bottom: 16px;
        padding-left: 16px;
    }

    .author-block {
        margin-bottom: 16px;
        font-size: 14px;
    }

    .kpis-row {
        flex-direction: column;
        gap: 16px;
        padding-top: 16px;
        margin-top: 8px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        /* Ensure separator is visible */
    }

    .kpi-value {
        font-size: 18px;
    }

    .kpi-desc {
        font-size: 13px;
    }

    .thumbnail-item {
        width: 120px;
        height: 68px;
        flex-shrink: 0;
    }

    .testimonial-text-card {
        min-width: 320px;
        max-width: 320px;
        padding: 24px;
        gap: 24px;
    }

    .quote-italic {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .refonte-case-studies {
        padding: 48px 16px;
    }

    .case-studies-title {
        font-size: 28px;
    }

    .card-media {
        min-height: 200px;
    }

    .case-study-card {
        padding: 16px 12px;
    }

    .testimonial-text-card {
        min-width: 280px;
        max-width: 280px;
        padding: 20px;
    }

    .cta-controls {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .carousel-nav {
        position: relative;
        right: auto;
    }
}