/* src/mkt/assets/css/services.css */

/* ============================================================
   1. GLOBAL LAYOUT FIXES
   ============================================================ */
.services-full-bleed-wrapper {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    position: relative;
    overflow-x: hidden;
}

.services-master-container {
    height: 2200vh;
    background: var(--bg-body);
}

.sticky-viewport {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#mainTitleContainer {
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    z-index: 10;
}

.cards-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================================
   2. BASIS KARTE (HYBRID DESIGN: GLASS LOOK)
   ============================================================ */
.scrolly-card {
    position: absolute;
    width: 280px;
    height: 200px;
    border-radius: 24px;
    overflow: hidden;
    opacity: 0;
    
    /* Hintergrund: Glas-Effekt */
    background: rgba(20, 20, 20, 0.6); /* Dunkles Glas */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* KEIN Border mehr! Stattdessen Lichtkanten via Shadow */
    border: none;
    
    /* Inset Shadows simulieren die geschliffene Kante */
    /* Oben/Links: Hell (Licht), Unten/Rechts: Dunkel (Schatten) */
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 0.15), /* Lichtkante Oben/Links */
        inset -1px -1px 0 rgba(0, 0, 0, 0.5),     /* Schattenkante Unten/Rechts */
        0 10px 30px rgba(0, 0, 0, 0.3);            /* Schlagschatten für Tiefe */
    
    will-change: transform, width, height, opacity;
    z-index: 5;
    
    transition: box-shadow 0.4s ease; /* Für den Glow-Effekt */
}

/* Light Mode Anpassung: Silber/Kristall Look */
[data-theme="light"] .scrolly-card {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 1),
        inset -1px -1px 0 rgba(0, 0, 0, 0.1), 
        0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Fokus Glow (Wenn Maus drüber oder aktiv) */
.scrolly-card.in-focus {
    z-index: 50;
    /* Sanfter Glow um die Karte */
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.05),
        0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Light Mode Fokus */
[data-theme="light"] .scrolly-card.in-focus {
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 1),
        0 0 15px rgba(0, 0, 0, 0.1),
        0 20px 50px rgba(0, 0, 0, 0.2);
}


/* Der Industrie-Blitz Effekt */
.scrolly-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 100%
    );
    transform: skewX(-30deg);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
}

.scrolly-card.shining::before {
    opacity: 1;
    left: 250%;
    transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Video & Overlays */
.service-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.6s ease, height 0.6s ease;
}

.scrolly-card.has-played .service-video-bg { opacity: 1; height: 100%; }
.scrolly-card.in-focus .service-video-bg { opacity: 1; height: 40%; }

/* Mini Content (Titel vor dem Zoom) */
.card-mini-content {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    transition: all 0.5s ease;
}

.scrolly-card.has-played .card-mini-content {
    height: 60px;
    top: auto;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.scrolly-card.has-played .title-text {
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

/* 3. CONTENT AREA & TYPOGRAPHY */
.card-full-content {
    position: relative;
    z-index: 5;
    display: none;
    height: 100%;
    flex-direction: column;
}

.card-text-area {
    position: absolute;
    top: 35%; /* Startet weiter oben für den Melt-Effekt (Desktop & Mobile) */
    left: 0;
    width: 100%;
    height: 65%;
    
    /* MELTING GRADIENT (Gilt jetzt auch für Desktop!) */
    background: linear-gradient(
        to bottom, 
        transparent 0%, 
        var(--glass-bg) 20%, /* Sanfter Übergang zur Kartenfarbe */
        var(--glass-bg) 100%
    );
    
    flex: 1;
    padding: 40px 50px; /* Mehr Padding oben für den Verlauf */
    overflow: hidden;
    z-index: 10;
}

/* Light Mode braucht anderen Gradient-Endpunkt */
[data-theme="light"] .card-text-area {
    background: linear-gradient(
        to bottom, 
        transparent 0%, 
        #f8f9fa 20%, 
        #f8f9fa 100%
    );
}

.text-scroll-track {
    display: block;
    width: 100%;
    transition: none !important;
    will-change: transform;
}

/* --- TYPOGRAPHY UPDATES (PROFI LOOK) --- */
.text-scroll-track h3 {
    font-size: 1.5rem; /* Etwas dezenter als vorher */
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.text-scroll-track .lead {
    font-size: 0.95rem; /* Kleiner = Professioneller */
    line-height: 1.7;   /* Mehr "Luft" zum Atmen */
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .text-scroll-track .lead {
    color: #444;
}

/* ============================================================
   4. MOBILE OVERRIDES (TUNNEL & MOBILE SPECIFIC MELT)
   ============================================================ */
@media (max-width: 991px) {
    .sticky-viewport { perspective: 1000px; }
    .cards-stage { transform-style: preserve-3d; }
    
    .scrolly-card {
        left: 50% !important;
        top: 50% !important;
        margin: 0 !important;
        width: 90vw !important;
        height: 70vh !important;
        max-height: 650px;
        opacity: 0;
        transition: none !important;
        /* Mobile: Ganz clean ohne Border, da der Verlauf wirkt */
        border: none !important; 
        background: transparent !important; 
        box-shadow: none !important; /* Kein Schatten im Tunnel, das verwirrt */
    }

    .service-video-bg {
        height: 100% !important; 
        transition: none !important;
        will-change: height, opacity;
        opacity: 1 !important;
        z-index: 0;
    }

    .card-mini-content {
        transition: none !important;
        will-change: opacity;
        z-index: 10;
    }

    .card-text-area {
        top: 35% !important; 
        height: 65% !important;
        /* Mobile: Harter Kontrastverlauf zu Schwarz für Lesbarkeit */
        background: linear-gradient(
            to bottom, 
            transparent 0%, 
            #050505 30%, 
            #050505 100%
        ) !important;
        
        padding-top: 80px !important; 
        padding-left: 25px !important;
        padding-right: 25px !important;
        
        opacity: 0; 
        will-change: opacity;
        z-index: 20;
    }

    [data-theme="light"] .card-text-area {
        /* Mobile: Harter Kontrastverlauf zu Schwarz für Lesbarkeit */
        background: linear-gradient(
            to bottom, 
            transparent 0%, 
            #f2f2f2 30%, 
            #f6f6f6 100%
        ) !important;
    }

    .text-scroll-track h3 {
        display: block !important;
        opacity: 1 !important;
        margin-bottom: 20px;
        color: #fff;
        text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    }
    
    .scrolly-card.has-played .card-mini-content { display: none !important; }
}

/* ============================================================
   4K / ULTRAWIDE MONITOR FIXES
   Verhindert, dass das Design auf riesigen Screens "explodiert"
   ============================================================ */
@media (min-width: 1921px) {
    
    /* 1. Zoomt alles etwas heran, damit es auf 4K nicht winzig wirkt */
    .cards-stage {
        transform: scale(1.3); 
        transform-origin: center center;
    }

    /* 2. ZWINGT die Karte, nicht breiter als ein schönes Laptop-Format zu werden */
    /* Das !important überschreibt die JS-Berechnung, falls diese zu groß wird */
    .scrolly-card {
        max-width: 1400px !important; 
        max-height: 800px !important;
    }

    /* 3. Passt die Textgröße für 4K an, damit man es lesen kann */
    .text-scroll-track h3 {
        font-size: 2rem !important;
    }
    .text-scroll-track .lead {
        font-size: 1.2rem !important;
        line-height: 1.6 !important;
    }
}

[data-theme="dark"] .text-gradient {
    background: none !important;
    -webkit-text-fill-color: #fff !important;
}