/* COMPAN V6 - Glassmorphism Pro - Index */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #3b82f6;
    --secondary: #06b6d4;
    --accent: #8b5cf6;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --bg-primary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1rem, 2vw, 1.0625rem);
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientFlow 20s ease infinite;
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2rem);
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
    animation: float 25s ease-in-out infinite;
}

body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.6), transparent);
    top: -250px;
    right: -250px;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.6), transparent);
    bottom: -200px;
    left: -200px;
    animation-delay: -12s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -50px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid var(--border);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Gradient border effect */
.container::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    z-index: -1;
}

header {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 3rem);
    position: relative;
}

h1::before {
    content: '❓';
    display: block;
    font-size: clamp(3rem, 8vw, 4.5rem);
    margin-bottom: 1rem;
    animation: levitate 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(59, 130, 246, 0.4));
}

@keyframes levitate {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 600;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    margin: clamp(2rem, 5vw, 3rem) 0;
}

.stat {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: clamp(1.5rem, 3vw, 2rem);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.stat:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.stat:hover::before {
    transform: scaleX(1);
}

.stat-value {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: var(--text-secondary);
    font-weight: 600;
}

nav {
    margin-top: clamp(2rem, 5vw, 3rem);
}

ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
}

li {
    animation: cardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

li:nth-child(1) { animation-delay: 0.1s; }
li:nth-child(2) { animation-delay: 0.2s; }
li:nth-child(3) { animation-delay: 0.3s; }
li:nth-child(4) { animation-delay: 0.4s; }
li:nth-child(5) { animation-delay: 0.5s; }

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

a {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 1.5rem);
    padding: clamp(1.25rem, 3vw, 1.75rem);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: clamp(1rem, 2vw, 1.0625rem);
    line-height: 1.5;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

/* Gradient glow on hover */
a::before {
    content: '';
    position: absolute;
    inset: -100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

a:hover::before {
    opacity: 1;
    animation: rotateGlow 3s linear infinite;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

a:hover,
a:focus-visible {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(59, 130, 246, 0.5);
}

.number {
    flex-shrink: 0;
    width: clamp(3rem, 6vw, 3.75rem);
    height: clamp(3rem, 6vw, 3.75rem);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 900;
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    border-radius: 1rem;
    position: relative;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

a:hover .number {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
}

.language-switcher {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    border-radius: 3rem;
    border: 1px solid var(--border);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.language-switcher:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.25);
}

.lang-label {
    font-size: 1.5rem;
}

.language-switcher select {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.language-switcher select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 0.375rem;
}

footer {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding-top: clamp(1.5rem, 4vw, 2rem);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    font-weight: 500;
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    ul {
        grid-template-columns: 1fr;
    }
    
    .language-switcher {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1.125rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 3rem;
    }
}

@media (min-width: 1024px) {
    ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (prefers-contrast: high) {
    a,
    .stat {
        border-width: 3px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --bg-glass: rgba(15, 23, 42, 0.7);
    }
    
    .container {
        background: rgba(15, 23, 42, 0.7);
    }
    
    .stat,
    a {
        background: rgba(30, 41, 59, 0.6);
    }
}

@media print {
    body {
        background: white;
        animation: none;
    }
    
    body::before,
    body::after {
        display: none;
    }
    
    .container {
        box-shadow: none;
        backdrop-filter: none;
    }
    
    .language-switcher {
        display: none;
    }
}

/* ===========================================================================
   CTA SECTION (Call-to-Action Block)
   Стили для кнопки призыва к действию на index страницах
   =========================================================================== */

.cta-section {
    margin: clamp(2rem, 5vw, 3rem) 0;
}

.cta-block {
    background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--secondary, #8b5cf6) 100%);
    color: white;
    border-radius: clamp(1rem, 2vw, 1.5rem);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.cta-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmerCta 3s infinite;
}

@keyframes shimmerCta {
    0% { left: -100%; }
    100% { left: 100%; }
}

.cta-block h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: white;
    position: relative;
    z-index: 1;
}


.cta-description {
    font-size: clamp(0.95rem, 2vw, 1.125rem);
    margin-bottom: 1.5rem;
    opacity: 0.95;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: clamp(0.875rem, 2vw, 1.125rem) clamp(1.5rem, 4vw, 2.5rem);
    background: white;
    color: var(--primary, #6366f1);
    font-weight: 800;
    font-size: clamp(1rem, 2vw, 1.125rem);
    border: none;
    border-radius: 3rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 52px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.cta-button::after {
    content: '→';
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.cta-button:hover::after {
    transform: translateX(5px);
}

/* ===========================================================================
   LANGUAGE SWITCHER FOOTER (Переключатель языков в футере)
   =========================================================================== */

.language-switcher-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.05));
    border-radius: 1rem;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    text-decoration: none;
    border-radius: 0.75rem;
    background: var(--bg-primary, white);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lang-flag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--primary, #6366f1);
}

.lang-flag.active {
    border-color: var(--primary, #6366f1);
    background: var(--primary, #6366f1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ===========================================================================
   RESPONSIVE для CTA и Language Switcher
   =========================================================================== */

@media (max-width: 640px) {
    .cta-block {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    .cta-button {
        width: 100%;
        justify-content: center;
    }
    
    .language-switcher-footer {
        padding: 0.75rem;
        gap: 0.375rem;
    }
    
    .lang-flag {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

@media (prefers-color-scheme: dark) {
    .language-switcher-footer {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .lang-flag {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .lang-flag:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* COMPAN: Кастомизация CTA для glassmorphism */
.cta-block {
    background: linear-gradient(135deg, var(--primary, #3b82f6) 0%, var(--secondary, #06b6d4) 100%);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
}

.language-switcher-footer {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
}

.lang-flag {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}
