/* ===== Case Studies Specific Styles ===== */

/* Hero Title - Ensure visibility */
.hero-title .title-line {
    overflow: hidden;
    display: block;
}

.hero-title .title-line-inner {
    display: inline-block;
    will-change: transform;
    /* Fallback: visible by default, GSAP will animate */
    transform: translateY(0);
    opacity: 1;
}

/* Animation fallback if GSAP doesn't load */
@supports not (animation: none) {
    .hero-title .title-line-inner {
        transform: translateY(0) !important;
    }
}

/* Floating Numbers Background */
.floating-number {
    font-family: 'Poppins', sans-serif;
    pointer-events: none;
}

.floating-number-1 {
    top: 15%;
    right: 10%;
    animation: floatNumber1 20s ease-in-out infinite;
}

.floating-number-2 {
    bottom: 20%;
    left: 5%;
    animation: floatNumber2 25s ease-in-out infinite;
}

.floating-number-3 {
    top: 60%;
    right: 20%;
    animation: floatNumber3 18s ease-in-out infinite;
}

@keyframes floatNumber1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-30px, 20px) rotate(5deg); }
    50% { transform: translate(20px, -30px) rotate(-3deg); }
    75% { transform: translate(-20px, -10px) rotate(2deg); }
}

@keyframes floatNumber2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(40px, -20px) rotate(-4deg); }
    66% { transform: translate(-30px, 30px) rotate(6deg); }
}

@keyframes floatNumber3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-50px, 40px) rotate(8deg); }
}

/* Case Orbs */
.case-orb {
    animation: caseOrbFloat 20s ease-in-out infinite;
}

.case-orb-1 { animation-delay: 0s; }
.case-orb-2 { animation-delay: -7s; }
.case-orb-3 { animation-delay: -14s; }

@keyframes caseOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
    25% { transform: translate(40px, -30px) scale(1.1); opacity: 0.2; }
    50% { transform: translate(-20px, 20px) scale(0.95); opacity: 0.12; }
    75% { transform: translate(30px, 40px) scale(1.05); opacity: 0.18; }
}

/* Filter Buttons */
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.filter-btn span {
    pointer-events: none;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(175, 84, 40, 0.3);
    color: #fff;
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(175, 84, 40, 0.2), rgba(175, 84, 40, 0.1));
    border-color: #AF5428;
    color: #AF5428;
    box-shadow: 0 0 20px rgba(175, 84, 40, 0.2);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn.active .filter-count {
    background: #AF5428;
    color: white;
}

/* Secondary Filter Buttons (Univers) */
.filter-btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.filter-btn-secondary span {
    pointer-events: none;
}

.filter-btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #9ca3af;
}

.filter-btn-secondary.active {
    border-color: #AF5428;
    color: #AF5428;
}

/* Case Cards */
.case-card {
    display: block;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.case-card[style*="display: none"] {
    display: none !important;
}

/* Ensure cards are visible by default */
.cases-grid .case-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
    display: block !important;
}

.cases-grid .case-card[style*="display: none"] {
    display: none !important;
    opacity: 0 !important;
}

.case-card-inner {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.case-card:hover .case-card-inner {
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(175, 84, 40, 0.15);
}

/* Case Card Glow */
.case-glow {
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(175, 84, 40, 0.15),
        transparent 40%
    );
}

/* Case Card Border Glow on Hover */
.case-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #AF5428, transparent 50%, #AF5428);
    border-radius: 26px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
}

.case-card:hover::before {
    opacity: 1;
}

/* KPI Badge Animation */
.case-kpi {
    transform: translateY(-10px);
    opacity: 0;
    animation: kpiSlideIn 0.6s ease forwards;
    animation-delay: 0.3s;
}

@keyframes kpiSlideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.case-card:hover .case-kpi {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(175, 84, 40, 0.4);
}

/* Counter Animation Wrapper */
.counter-wrapper {
    display: inline-block;
    font-weight: 700;
    color: #AF5428;
}

/* Hero Stats Animation */
.hero-stats .stat-item {
    opacity: 0;
    transform: translateY(30px);
}

/* Scroll Indicator Enhancement */
#hero-cases .scroll-indicator {
    animation: scrollFade 2s ease-in-out infinite;
}

@keyframes scrollFade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* Grid Masonry Effect */
.cases-grid .case-card:nth-child(2) {
    transform: translateY(40px);
}

.cases-grid .case-card:nth-child(5) {
    transform: translateY(40px);
}

.cases-grid .case-card:nth-child(8) {
    transform: translateY(40px);
}

/* Case Card Content Reveal */
.case-content {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    z-index: 10;
    position: relative;
}

.case-title,
.case-desc,
.case-tag,
.case-cta {
    position: relative;
    z-index: 11;
    opacity: 1 !important;
    visibility: visible !important;
}

.case-desc {
    opacity: 0.8 !important;
}

.case-card:hover .case-desc {
    opacity: 1 !important;
}

/* Video Preview Overlay (for cards with video) */
.case-card[data-has-video]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(175, 84, 40, 0.9);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 10;
    pointer-events: none;
}

.case-card[data-has-video]:hover::after {
    opacity: 1;
}

/* Vanilla Tilt Overrides */
.js-tilt-glare-inner {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0) 100%
    ) !important;
}

/* ===== Individual Case Study Page Styles ===== */

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #AF5428, #d17a5c);
    z-index: 9999;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.1s linear;
}

/* Case Study Hero */
.case-hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 4rem;
    overflow: hidden;
}

.case-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.case-hero-bg img,
.case-hero-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.case-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(46, 40, 36, 1) 0%,
        rgba(46, 40, 36, 0.9) 30%,
        rgba(46, 40, 36, 0.5) 60%,
        rgba(46, 40, 36, 0.3) 100%
    );
    z-index: 1;
}

.case-hero-content {
    position: relative;
    z-index: 2;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #AF5428;
}

.breadcrumb svg {
    width: 1rem;
    height: 1rem;
    opacity: 0.5;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.kpi-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s ease;
}

.kpi-card:hover {
    border-color: #AF5428;
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(175, 84, 40, 0.15);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #AF5428;
    margin-bottom: 0.5rem;
}

.kpi-label {
    font-size: 0.875rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Section Styles */
.case-section {
    padding: 5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.case-section:last-child {
    border-bottom: none;
}

.section-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, rgba(175, 84, 40, 0.2), rgba(175, 84, 40, 0.1));
    border: 1px solid rgba(175, 84, 40, 0.3);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.section-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #AF5428;
}

/* Action List */
.action-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.action-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateX(-20px);
}

.action-item.revealed {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.5s ease;
}

.action-check {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(135deg, #AF5428, #d17a5c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
}

.action-check svg {
    width: 0.875rem;
    height: 0.875rem;
    color: white;
}

/* Video Carousel */
.video-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.video-carousel::-webkit-scrollbar {
    display: none;
}

.video-item {
    flex-shrink: 0;
    width: 100%;
    max-width: 400px;
    scroll-snap-align: start;
    border-radius: 1.5rem;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease;
}

.video-item:hover {
    transform: scale(1.02);
}

.video-item video {
    width: 100%;
    height: auto;
    display: block;
}

/* Navigation Arrows with Preview */
.case-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    gap: 2rem;
}

.case-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    max-width: 45%;
    overflow: hidden;
}

.case-nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(175, 84, 40, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.case-nav-link:hover::before {
    opacity: 1;
}

.case-nav-link:hover {
    border-color: #AF5428;
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.case-nav-link.prev {
    justify-content: flex-start;
}

.case-nav-link.next {
    justify-content: flex-end;
}

.case-nav-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.4s ease;
}

.case-nav-link:hover .case-nav-preview {
    transform: scale(1.1);
}

.case-nav-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(50%);
    transition: filter 0.4s ease;
}

.case-nav-link:hover .case-nav-preview img {
    filter: grayscale(0%);
}

.case-nav-info {
    position: relative;
    z-index: 1;
}

.case-nav-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.case-nav-title {
    font-weight: 600;
    color: white;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.case-nav-link:hover .case-nav-title {
    color: #AF5428;
}

.case-nav-arrow {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.case-nav-link.prev:hover .case-nav-arrow {
    transform: translateX(-5px);
}

.case-nav-link.next:hover .case-nav-arrow {
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .case-nav {
        flex-direction: column;
    }
    
    .case-nav-link {
        max-width: 100%;
    }
    
    .case-nav-preview {
        width: 60px;
        height: 60px;
    }
}

/* LinkedIn Embed Cards */
.linkedin-embed-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.linkedin-embed-card:hover {
    transform: translateY(-8px);
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video Carousel Improvements */
.video-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.video-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s ease;
}

.video-item:hover {
    border-color: rgba(175, 84, 40, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.video-item video {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    background: #000;
}

/* 360 View Styles */
.google-360-container {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
}

.google-360-container iframe {
    display: block;
}

/* Before/After Comparison */
.comparison-container {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.comparison-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 2rem;
}

.comparison-item.before {
    border-color: rgba(239, 68, 68, 0.3);
}

.comparison-item.after {
    border-color: rgba(34, 197, 94, 0.3);
}

.comparison-label {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.comparison-item.before .comparison-label {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.comparison-item.after .comparison-label {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .cases-grid .case-card:nth-child(2),
    .cases-grid .case-card:nth-child(5),
    .cases-grid .case-card:nth-child(8) {
        transform: translateY(0);
    }
    
    .floating-number {
        display: none;
    }
}

@media (max-width: 768px) {
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    .filter-count {
        min-width: 1.25rem;
        height: 1.25rem;
        font-size: 0.65rem;
    }
    
    .case-card-inner {
        aspect-ratio: 3/4;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-container {
        grid-template-columns: 1fr;
    }
    
    .case-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .case-nav-link {
        width: 100%;
        justify-content: center;
    }
    
    .video-item {
        max-width: 85vw;
    }
}

/* Light Theme Adjustments */
.light-theme .filter-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #44403C;
}

.light-theme .filter-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.light-theme .filter-btn.active {
    background: linear-gradient(135deg, rgba(175, 84, 40, 0.15), rgba(175, 84, 40, 0.08));
}

.light-theme .case-card-inner {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.light-theme .case-overlay {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
}

.light-theme .case-title {
    color: #1C1917;
}

.light-theme .case-desc {
    color: #44403C;
}

.light-theme .kpi-card {
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.01));
    border-color: rgba(0, 0, 0, 0.08);
}

.light-theme .case-section {
    border-color: rgba(0, 0, 0, 0.05);
}

.light-theme .case-nav-link {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

.light-theme .case-nav-title {
    color: #1C1917;
}

.light-theme .floating-number {
    color: rgba(175, 84, 40, 0.08);
}

/* Animation Classes for JS */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay classes */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

