/* HOME.CSS - Головна сторінка з фоновими відео згідно STYLE.MDC */

/* Hero використовує hero-parallax.css компонент */

/* ===== SERVICES SECTION - ПЕРША СЕКЦІЯ ПІСЛЯ HERO ===== */
.services-section {
    position: relative;
    width: 100%;
    padding: var(--space-xl) 0;
    padding-top: 60px;
    background: #090407;
    z-index: 10;
    border-radius: 20px 20px 0 0;
    margin-top: -20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
}

.services-content h2 {
    margin-bottom: var(--space-xl);
}

/* Services Grid - 4 картки в 1 ряд */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

/* Service Card - напівпрозорі з витягнутими цифрами */
.service-card {
    position: relative;
    min-height: 500px;
    overflow: visible;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.4s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Фонові зображення для карток послуг */
.service-card[data-service="1"] {
    background-image: url('/static/images/services/web.png');
    background-color: #1a1a1a;
}

.service-card[data-service="2"] {
    background-image: url('/static/images/services/edu.png');
    background-color: #2a2a2a;
}

.service-card[data-service="3"] {
    background-image: url('/static/images/services/mob.png');
    background-color: #1a1a1a;
}

.service-card[data-service="4"] {
    background-image: url('/static/images/services/media.png');
    background-color: #2a2a2a;
}

/* Overlay - тільки для hover ефекту */
.service-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
    border-radius: 12px;
    opacity: 0;
}

.service-card:hover .service-card-overlay {
    background: linear-gradient(180deg, rgba(225, 72, 17, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
    opacity: 1;
}

.service-card:hover {
    border-color: rgba(225, 72, 17, 0.6);
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 25px 60px rgba(225, 72, 17, 0.3);
    background-color: rgba(255, 255, 255, 0.2);
}

/* Контент картки - без постійних тіней */
.service-card-content {
    position: relative;
    z-index: 2;
    padding: var(--space-md) var(--space-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: var(--color-white);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 70%);
    border-radius: 12px;
}

.service-number {
    position: absolute;
    top: -30px;
    right: -20px;
    font-size: 120px;
    font-weight: 900;
    color: var(--color-red);
    opacity: 0.8;
    line-height: 1;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease-out;
    z-index: 10;
    background: linear-gradient(135deg, var(--color-red), #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.service-card:hover .service-number {
    transform: scale(1.1) rotate(-5deg);
    opacity: 1;
    text-shadow: 6px 6px 12px rgba(0, 0, 0, 0.4);
}

.service-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--color-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    line-height: 1.1;
    letter-spacing: -0.5px;
    transition: all 0.3s ease-out;
}

.service-card:hover .service-title {
    transform: translateY(-2px);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 1);
}

.service-description {
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-white);
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    transition: all 0.3s ease-out;
}

.service-card:hover .service-description {
    opacity: 1;
    transform: translateY(-1px);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
}

/* ===== CTA СЕКЦІЯ З ВІДЕО ФОНОМ ===== */
.cta-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-content-base);
    overflow: hidden;
    isolation: isolate;
}

/* Фіксоване відео для CTA секції (як у hero-parallax) */
.cta-section .video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: var(--z-background, -1);
}

/* Фіксований overlay для CTA */
.cta-section .video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: var(--z-video-background, 0);
}

.cta-content {
    position: relative;
    z-index: 100;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    pointer-events: auto;
}

.cta-content h2 {
    font-size: 80px;
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -2px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: var(--space-md);
}

.cta-content p {
    font-size: 20px;
    line-height: 1.6;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: var(--space-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== ДЕКОРАТИВНІ ЕЛЕМЕНТИ ===== */
.services-section::before {
    content: '◆';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    color: var(--color-red);
    font-size: 32px;
    opacity: 0.5;
}

.services-section::after {
    content: '⟲';
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    color: var(--color-red);
    font-size: 40px;
    font-weight: 700;
    opacity: 0.4;
}

/* ===== АДАПТАЦІЯ ПЛАНШЕТИ ===== */
@media (max-width: 1024px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--space-xs);
    }

    .hero-buttons .btn {
        width: 280px;
    }

    .services-section {
        padding: var(--space-lg) 0;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .service-card {
        min-height: 450px;
    }

    .service-number {
        font-size: 80px;
        top: -20px;
        right: -15px;
    }

    .service-title {
        font-size: 26px;
    }

    .service-description {
        font-size: 14px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 250px;
    }
}

/* ===== АДАПТАЦІЯ ПАРАЛАКС ДЛЯ МОБІЛЬНИХ ===== */
@media (max-width: 767px) {
    .services-section {
        border-radius: 16px 16px 0 0;
        margin-top: -16px;
        padding-top: 40px;
    }

    .cta-section {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }

    .cta-content h2 {
        font-size: 48px;
        letter-spacing: -1px;
    }

    .cta-content p {
        font-size: 16px;
    }
}

/* ===== АДАПТАЦІЯ МОБІЛЬНІ (iOS Safari) ===== */
@media (max-width: 767px) {

    /* Services для мобільних - висота як на десктопі */
    .services-section {
        padding: var(--space-md) 0;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .service-card {
        min-height: 500px;
        border-radius: 12px;
    }

    .service-card-overlay {
        border-radius: 12px;
    }

    .service-card-content {
        padding: var(--space-md) var(--space-sm);
        background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 70%);
        border-radius: 12px;
    }

    .service-number {
        font-size: 70px;
        top: -15px;
        right: -10px;
    }

    .service-title {
        font-size: 26px;
        margin-bottom: var(--space-xs);
        line-height: 1.1;
    }

    .service-description {
        font-size: 14px;
        line-height: 1.4;
    }

    .service-card:hover {
        transform: translateY(-6px) scale(1.01);
        box-shadow: 0 15px 40px rgba(225, 72, 17, 0.35);
    }

    .services-cta {
        padding: var(--space-sm);
        margin: 0 var(--space-xs);
    }

    .cta-buttons {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .cta-buttons .btn {
        width: 100%;
    }

    /* Декоративні елементи для мобільних */
    .services-section::before {
        font-size: 24px;
        top: var(--space-xs);
        right: var(--space-xs);
    }

    .services-section::after {
        font-size: 28px;
        bottom: var(--space-xs);
        left: var(--space-xs);
    }
}

/* ===== АНІМАЦІЇ ===== */
@media (prefers-reduced-motion: no-preference) {
    .service-card {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.6s ease-out;
    }

    .service-card.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== iOS SAFARI СПЕЦИФІЧНІ ФІКСИ ===== */
@supports (-webkit-touch-callout: none) {
    /* Фікси для мобільної версії iOS Safari */
    @media (max-width: 767px) {
        .services-section {
            padding-top: max(var(--space-lg), env(safe-area-inset-top));
            padding-left: max(var(--space-xs), env(safe-area-inset-left));
            padding-right: max(var(--space-xs), env(safe-area-inset-right));
            padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
        }
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.service-card {
    will-change: transform;
}