/* CSS Custom Properties (Variables) */
:root {
    /* Color Palette */
    --primary-green: #19861c;
    --secondary-green: #a9a9a9;
    --accent-green: #48a24c;
    --light-green: #E8F5E8;
    --dark-green: #1B5E20;
    --white: #ffffff;
    --light-gray: #F8F9FA;
    --medium-gray: #6C757D;
    --dark-gray: #212529;
    --text-primary: #2C3E50;
    --text-secondary: #5A6C7D;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0F7B59 0%, #4CAF50 100%);
    --gradient-secondary: linear-gradient(135deg, #81C784 0%, #4CAF50 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 25px 50px rgba(0,0,0,0.25);

    /* Typography */
    --font-primary: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Playfair Display', 'Georgia', serif;

    /* Animations */
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --hero-bg-duration: 35s;
    --title-glow-duration: 10s;
    --title-shimmer-duration: 12s;
    --container-shimmer-duration: 8s;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background: url('/images/web/aboutBack.png') repeat;
    background-size: 1910px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== HERO SECTION ========== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 4rem 1rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    animation: heroShimmer 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroShimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%); }
    50% { transform: translateX(100%) translateY(100%); }
}

.hero-content {
    position: relative;
    z-index: 2;
    backdrop-filter: blur(20px);
    background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.3) 100%);
    border-radius: 25px;
    padding: 3rem 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
    max-width: 900px;
    margin: 0 auto;
    animation: heroSlideUp 1.2s var(--ease-out-expo) forwards;
    transform: translateY(60px);
    opacity: 0;
}

.hero-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: containerShimmer var(--container-shimmer-duration) ease-in-out infinite;
    pointer-events: none;
    border-radius: 25px;
}

@keyframes containerShimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%); }
    50% { transform: translateX(100%) translateY(100%); }
}

@keyframes heroSlideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero h1 {
    font-family: var(--font-secondary);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 4px 8px rgba(0,0,0,0.4);
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F8FF 50%, #E8F5E8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow var(--title-glow-duration) ease-in-out infinite alternate;
    position: relative;
}

.hero h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 45%, rgba(255, 255, 255, 0.3) 50%, transparent 55%);
    animation: titleShimmer var(--title-shimmer-duration) ease-in-out infinite;
    pointer-events: none;
}

@keyframes titleShimmer {
    0%, 100% { transform: translateX(-200%); }
    50% { transform: translateX(200%); }
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 8px rgba(255,255,255,0.6)); }
    100% { filter: drop-shadow(0 0 25px rgba(255,255,255,0.9)); }
}

.hero-content > p {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    animation: fadeInUp 1.4s var(--ease-out-expo) 0.4s forwards;
    opacity: 0;
    transform: translateY(40px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.intro-text {
    animation: fadeInUp 1.6s var(--ease-out-expo) 0.8s forwards;
    opacity: 0;
    transform: translateY(40px);
}

.intro-text p {
    font-size: clamp(1rem, 2.2vw, 1.0rem);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-weight: 300;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== MAIN CONTENT ========== */
.main-content {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
}

.section {
    position: relative;
    padding: 3rem 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
}

/* ========== UNIFIED BOX - ФИКСИРАН LAYOUT ========== */
.content-box {
    backdrop-filter: blur(20px);
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.2) 100%);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-out-quart);
    width: 100%;
    max-width: 1300px;
}

.unified-box {
    display: grid;
    grid-template-columns: 1fr 460px;
    grid-template-rows: auto auto;
    gap: 2.5rem 3rem;
    align-items: start;
}

/* Заглавие - цялата ширина горе, центрирано */
.unified-box .text-content:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
    margin: 0;
    padding: 0;
}

.unified-box .text-content:nth-child(1) h2 {
    margin: 0;
    padding: 0;
}

/* Текст - ляво долу */
.unified-box .text-content:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

/* Видео - дясно долу, ФИКСИРАН РАЗМЕР */
.unified-box .video-content {
    grid-column: 2;
    grid-row: 2;
    width: 460px;
    height: 255px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* REVERSE секции - ОБРЪЩАМЕ САМИТЕ КОЛОНИ */
.section.reverse .unified-box {
    grid-template-columns: 460px 1fr;
}

/* REVERSE секции - разменени позиции */
.section.reverse .unified-box .text-content:nth-child(3) {
    grid-column: 2;
}

.section.reverse .unified-box .video-content {
    grid-column: 1;
}

/* ========== ВИДЕО - ФИКСИРАН РАЗМЕР ========== */
.video-content mux-player {
    width: 460px !important;
    height: 259px !important;
    border-radius: 15px;
    overflow: hidden;
    display: block;
    --controls: none;
}

/* ========== SCALING ЗА РАЗЛИЧНИТЕ СЕКЦИИ ========== */
/* Section 1 */
.video-section-1 .video-content mux-player {
    --video-scale: 1.2;
}

/* Section 2 */
.video-section-2 .video-content mux-player {
    --video-scale: 1.77;
}

/* Section 3 */
.video-section-3 .video-content mux-player {
    --video-scale: 1.02;
}

/* Section 4 */
.video-section-4 .video-content mux-player {
    --video-scale: 1.77;
}

/* Section 5 */
.video-section-5 .video-content mux-player {
    --video-scale: 1.34;
}

/* Section 6 */
.video-section-6 .video-content mux-player {
    --video-scale: 1;
}

/* Section 7 */
.video-section-7 .video-content mux-player {
    --video-scale: 1.56;
}

/* Section 8 */
.video-section-8 .video-content mux-player {
    --video-scale: 2.63;
    margin-top: 60px;
}

/* Section 9 */
.video-section-9 .video-content mux-player {
    --video-scale: 1.2;
}

/* ========== ТЕКСТ СТИЛОВЕ ========== */
.content-box h2 {
    font-family: var(--font-secondary);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #FFFFFF 0%, #E8F5E8 50%, #81C784 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

/* Иконите наследяват градиентния ефект като текста */
.content-box h2 i {
    display: inline-block;
    margin-right: 0.5rem;
}

.content-box h2::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 45%, rgba(255, 255, 255, 0.2) 50%, transparent 55%);
    animation: titleShimmer var(--title-shimmer-duration) ease-in-out infinite;
    pointer-events: none;
}

.content-box p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.75;
    font-weight: 300;
    margin: 0 0 1rem 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    text-align: left;
}

/* ========== ЕФЕКТИ ========== */
.content-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    animation: contentShimmer 12s ease-in-out infinite;
    pointer-events: none;
    border-radius: 20px;
}

@keyframes contentShimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%); }
    50% { transform: translateX(100%) translateY(100%); }
}

.content-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.3);
}

.section:nth-child(odd) {
    background: linear-gradient(135deg, rgba(15, 123, 89, 0.03) 0%, rgba(76, 175, 80, 0.02) 100%);
}

.section:nth-child(even) {
    background: linear-gradient(135deg, rgba(25, 134, 28, 0.02) 0%, rgba(15, 123, 89, 0.03) 100%);
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.01) 50%, transparent 52%);
    animation: sectionShimmer 20s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.3;
}


@keyframes sectionShimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%); }
    50% { transform: translateX(100%) translateY(100%); }
}

/* ========== ВИДЕО WRAPPER - С OVERFLOW HIDDEN ========== */
.video-content {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

/* ========== ВИДЕО - ФИКСИРАН РАЗМЕР + SCALING ========== */
.video-content mux-player {
    width: 460px !important;
    height: 259px !important;
    border-radius: 15px;
    display: block;
    --controls: none;
    transform: scale(var(--video-scale, 1));
    transform-origin: center center;
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.content-box:focus-within {
    outline: 2px solid rgba(76, 175, 80, 0.6);
    outline-offset: 2px;
}

/* ========== PRINT ========== */
@media print {
    .hero::before,
    .content-box::before,
    .section::before,
    .hero-content::before {
        display: none;
    }

    .hero,
    .content-box {
        box-shadow: none;
        background: white;
        color: black;
    }
}