/* KOL Case Studies Section */
.kol-case-studies-section {
    margin-top: 50px;
    max-width: 1838px;
    width: calc(100% - 82px);
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    /* padding: 0 40px; */
    box-sizing: border-box;
}

.case-studies-title {
    margin-bottom: 82px;
}

.case-studies-title span {
    color: var(--text-dark);
    font-size: var(--text-h2);
    letter-spacing: 1.16px;
    font-family: var(--font-alibaba-puhuiti);
    font-weight: var(--weight-semibold);
    line-height: 56px;
}

.case-studies-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    margin-bottom: 0;
}

.case-tab {
    padding-top: 9px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
}

.case-tab:hover {
    background: #FFFFFF;
}

.case-tab:focus {
    outline: none;
}

.case-tab:active {
    background: #F7F7F7;
}

.case-tab.active {
    background: #F7F7F7;
    border-radius: 30px 30px 0px 0px;
}

.case-tab img {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

/* Case Display Section */
.case-display-section {
    margin-top: 0;
    max-width: 1838px;
    width: calc(100% - 82px);
    margin-left: auto;
    margin-right: auto;
    /* Remove overflow hidden to ensure border radius on wrapper shows properly if margins exist, 
       but wrapper is full width so it's fine. 
       Radius logic will be on wrapper. */
}

.case-display-wrapper {
    display: flex;
    /* Top gray (354px) + Bottom pink (500px) = 854px */
    min-height: 824px;
    position: relative;
    overflow: hidden; /* Ensure rounded corners clip the backgrounds */
    
    /* Remove direct background, use pseudo-elements instead */
    background: transparent;
    
    /* Default Radius (Middle behavior) */
    border-radius: 30px 30px 30px 30px;
    transition: border-radius 0.3s ease;
    
    /* Fix for border-radius overflow on Linux/Chrome */
    transform: translate3d(0, 0, 0); /* Stronger hardware acceleration */
    backface-visibility: hidden;
    will-change: transform;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    
    /* Optional: Ensure z-index is handled properly */
    z-index: 1;
}

/* Swipe Indicators (Mobile Only) */
.swipe-indicator {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.25);
    border-radius: 50%;
    z-index: 20;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* Allow clicks */
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.swipe-indicator svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.swipe-indicator.left { left: 10px; }
.swipe-indicator.right { right: 10px; }

/* Slide Animation States */
.case-display-wrapper.animating {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.case-display-wrapper.slide-out-left {
    opacity: 0;
    transform: translateX(-30px);
}

.case-display-wrapper.slide-out-right {
    opacity: 0;
    transform: translateX(30px);
}

.case-display-wrapper.slide-in-from-right {
    opacity: 0;
    transform: translateX(30px);
}

.case-display-wrapper.slide-in-from-left {
    opacity: 0;
    transform: translateX(-30px);
}

/* Gray Background (Top) */
.case-display-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 355px; /* 354px + 1px overlap to prevent seam */
    background: var(--background-gray);
    z-index: 0;
}

/* Image Background (Bottom) */
.case-display-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 596px;
    background-image: url('../../images/image/点点.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Dynamic Border Radius Classes */
.case-display-wrapper.radius-first-active {
    border-radius: 0 30px 30px 30px; /* Top-Left Square */
}

.case-display-wrapper.radius-last-active {
    border-radius: 30px 0 30px 30px; /* Top-Right Square */
}

.case-display-wrapper.radius-middle-active {
    border-radius: 30px 30px 30px 30px; /* Both Top Rounded */
}

/* Left Column - Media area spanning full height */
.case-left-column {
    width: 42%;
    display: flex;
    flex-direction: column;
    /* Removed background, handled by wrapper */
    background: transparent;
    padding: 3rem 1rem 1rem 7rem;
    position: relative;
    z-index: 1; /* Ensure content sits above background */
}

.case-media-row {
    display: flex;
    gap: 2.5rem;
    z-index: 2;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.case-media-item {
    flex: 1;
    background: #D8D8D8;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    aspect-ratio: 9/16; 
    max-width: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.case-media-item:first-child {
    max-width: 305px;
    margin-top: 60px; /* Left lower */
}

.case-media-item:last-child {
    max-width: 305px;
    margin-top: -120px; /* Right higher */
}

.case-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    cursor: pointer;
}

.media-placeholder {
    width: 100%;
    height: 100%;
    background: #C5C5C5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px; /* Reduced from clamp(50-70) for elegance */
    height: 56px;
    background: rgba(255, 255, 255, 0.7); /* Translucent white */
    backdrop-filter: blur(12px); /* Frosted glass effect */
    border: 1px solid rgba(255, 255, 255, 0.5); /* Subtle border for definition */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px; /* Optical center correction for play triangle */
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10;
    pointer-events: auto;
    opacity: 0;
}

.play-button svg {
    width: 18px;
    height: 18px;
    display: block;
}

.case-media-item:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.95); /* Solid white on hover */
    transform: translate(-50%, -50%) scale(1.1) !important; /* Override parent hover scale if needed */
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    color: #ff004f; /* Ensure vibrant color */
}

/* Removed .case-left-dots and .dot-pattern-left as they are no longer used */

/* Right Column - Gray top, Red bottom */
.case-right-column {
    width: 58%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.case-gray-area {
    background: transparent; /* Removed background-gray, handled by wrapper */
    height: 324px;
    padding: 3rem 11rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.case-title {
    font-size: var(--text-h2);
    font-family: var(--font-alibaba-puhuiti);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2rem;
    line-height: 1.375; /* 55px / 40px */
}

.case-stats {
    display: flex;
    gap: 3rem;
    align-items: baseline;
}

.stat-group {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-label {
    font-size: var(--text-h4);
    font-family: var(--font-alibaba-puhuiti);
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.4; /* 42px / 30px */
}

.stat-number {
    font-size: var(--text-display-xs);
    font-family: var(--font-alibaba-puhuiti);
    font-weight: 600;
    color: var(--primary-color);
    line-height: 0.7; /* 42px / 60px */
}

/* Red Area (Now transparent, handled by wrapper) */
.case-red-area {
    background: transparent;
    height: 500px;
    padding: 4rem 6rem 4rem 11rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Removed .dot-pattern-right */

.case-details-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 100%;
}

.case-detail-section {
    margin-bottom: 2rem;
}

.case-detail-section:last-child {
    margin-bottom: 0;
}

.case-detail-section h3 {
    font-size: var(--text-xl);
    font-family: var(--font-alibaba-puhuiti);
    font-weight: var(--weight-bold);
    margin-bottom: 0.5rem;
    color: white;
    line-height: 1.423; /* 37px / 26px */
}

.case-detail-section p {
    font-size: var(--text-sm);
    font-family: var(--font-alibaba-puhuiti);
    line-height: 1.875; /* 30px / 16px */
    color: white;
    opacity: 0.95;
    max-width: 800px;
}

.creators-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.creator-tag {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: white;
    color: var(--text-dark);
    border-radius: 30px;
    font-size: var(--text-sm);
    font-family: var(--font-alibaba-puhuiti);
    font-weight: var(--weight-medium);
}

/* Success Cases Section */
.success-cases-section {
    margin-top: -1px;
}

.success-cases-image {
    max-width: 1920px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Additional Cases Grid Section */
.cases {
    padding: 80px 0;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 3rem;
}

.case-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    opacity: 0;
    transform: translateY(30px);
}

.case-placeholder.fade-in-up {
    opacity: 1;
    transform: translateY(0);
}

.case-placeholder:hover {
    transform: translateY(-5px);
    border-color: #ff6b9d;
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.2);
}

.case-content {
    text-align: center;
}

.case-content h4 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.case-content p {
    color: #ff6b9d;
    font-weight: 600;
    font-size: 1rem;
}

.cases-bottom {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
}

.bottom-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.bottom-item {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b9d, #ff8cc8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: transform 0.3s ease;
}

.bottom-item:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    /* Success Cases Tablet */
    .success-cases-image {
        width: 100%;
        height: auto;
    }

    /* Tabs Horizontal Scroll on Tablet */
    .case-studies-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }

    .case-tab {
        flex: 0 0 auto;
        width: 150px; /* Slightly larger than mobile */
        padding: 10px;
    }

    .case-tab img {
        height: 60px; /* Adjust size */
        max-width: 140px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .kol-case-studies-section {
        margin-top: 20px; /* Reduced from 50px */
        width: calc(100% - 30px);
        margin-left: auto;
        margin-right: auto;
    }

    .case-display-section {
        width: calc(100% - 30px);
        margin-left: auto;
        margin-right: auto;
    }

    .case-studies-title {
        margin-bottom: 20px; /* Reduced from 82px */
    }

    .case-studies-title span {
        font-size: var(--text-h2);
        line-height: 1.4;
        white-space: normal;
    }

    /* Tabs Horizontal Scroll on Mobile - Reverted to Scrolling Layout */
    .case-studies-tabs {
        justify-content: flex-start;
        flex-wrap: nowrap; /* Single row */
        overflow-x: auto;
        padding-bottom: 10px; /* Space for scrollbar if visible */
        width: 100%;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        margin-bottom: 20px;
        padding-left: 0;
        padding-right: 0;
    }

    /* Hide scrollbar for cleaner look */
    .case-studies-tabs::-webkit-scrollbar {
        display: none;
    }

    .case-tab {
        flex: 0 0 auto; /* Don't shrink, auto width based on content */
        width: 25vw; /* Reduced from 120px to show part of 4th item */
        padding: 5px;
        border-radius: 6px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .case-tab.active {
        border-radius: 6px;
    }

    .case-tab img {
        height: 28px; /* Smaller logos to fit */
        max-width: 100%;
        object-fit: contain;
    }

    .case-display-wrapper {
        flex-direction: column;
        border-radius: 20px;
        overflow: hidden;
        background: transparent;
        min-height: auto; /* Reset desktop min-height */
    }
    
    /* Reset dynamic border radius on mobile as layout is stacked */
    .case-display-wrapper.radius-first-active,
    .case-display-wrapper.radius-last-active,
    .case-display-wrapper.radius-middle-active {
        border-radius: 20px;
    }
    
    .swipe-indicator {
        display: flex;
        opacity: 1; /* Fully visible */
        top: 60px; /* Centered in the gray header area */
        transform: translateY(-50%);
        background: transparent; /* Remove dark bubble */
        width: 40px; /* Larger touch target */
        height: 40px;
    }
    
    .swipe-indicator svg {
        fill: var(--text-dark); /* Dark arrow for contrast on gray background */
        width: 24px;
        height: 24px;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); /* Subtle shadow for depth */
    }

    .swipe-indicator.left { left: 5px; }
    .swipe-indicator.right { right: 5px; }
    .case-display-wrapper::before,
    .case-display-wrapper::after {
        display: none;
    }
    
    /* 1. Content First (Order 1) */
    .case-right-column {
        width: 100%;
        order: 1;
    }
    
    /* 2. Media Second (Order 2) */
    .case-left-column {
        width: 100%;
        order: 2;
        background: #ff1654; /* Match Red Area Background */
        padding: 5px 20px 25px 20px; /* Reduced top/bottom padding */
        min-height: auto;
        border-radius: 0 0 20px 20px; /* Bottom rounded corners */
    }
    
    .case-media-row {
        flex-direction: row;
        gap: 12px;
        align-items: flex-start;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .case-media-item {
        min-height: auto;
        width: 48%; /* Side by side */
        max-width: 48% !important;
        aspect-ratio: 9/16;
        background: #D8D8D8;
        box-shadow: none;
        margin-top: 10px; /* Small top margin */
    }
    
    /* Remove stagger effect for flat alignment */
    .case-media-item:first-child,
    .case-media-item:last-child {
        margin-top: 10px !important;
        max-width: 48% !important;
    }
    
    .case-gray-area {
        padding: 15px 40px; /* Increased side padding to accommodate arrows */
        height: auto;
        align-items: center;
        text-align: center;
        background: #F7F7F7; /* Light Gray for Top Part */
        border-radius: 20px 20px 0 0; /* Top rounded corners */
    }
    
    .case-title {
        font-size: 1.25rem; /* Slightly smaller title */
        text-align: center;
        margin-bottom: 8px; /* Tightened from 10px */
        line-height: 1.3;
    }
    
    .case-stats {
        justify-content: center;
        width: 100%;
        gap: 1rem; /* Reduced gap */
    }
    
    /* Adjust stat sizes for mobile compactness */
    .stat-label {
        font-size: 0.9rem;
    }
    .stat-number {
        font-size: 1.5rem;
    }
    
    .case-red-area {
        padding: 20px 20px 5px 20px; /* Tightened top/bottom padding */
        height: auto;
        min-height: auto;
        background: #ff1654; /* Solid Red Background */
        border-radius: 0; /* Flat connection */
    }
    
    /* Hide Background and Strategy sections on mobile as requested */
    .case-details-content .case-detail-section:nth-child(1),
    .case-details-content .case-detail-section:nth-child(2) {
        display: none;
    }
    
    .case-detail-section {
        margin-bottom: 12px; /* Tightened from 1rem/16px */
    }
    
    .case-detail-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem; /* Reduced heading spacing */
    }
    
    .case-detail-section p {
        font-size: 0.9rem;
        line-height: 1.5;
        opacity: 0.95;
    }
    
    /* Creators Pill Box Style */
    .creators-tags {
        display: block;
        width: 100%;
    }
    
    .creator-tag {
        display: block;
        width: 100%;
        background: white;
        color: #333;
        text-align: center;
        padding: 12px 10px;
        border-radius: 12px; /* Changed from 30px to match video radius */
        font-size: 0.9rem;
        font-weight: 500;
        white-space: normal;
        line-height: 1.4;
    }
    
    .case-left-dots {
        display: none;
    }
    
    .play-button {
        width: 44px;
        height: 44px;
        padding-left: 3px; 
    }

    .play-button svg {
        width: 14px;
        height: 14px;
    }
    
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    .bottom-grid {
        gap: 1rem;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}
