/* ===========================================================================
   MODERN TEMPLATE V6 - "Bold Contemporary"
   Geometric, Vibrant, Cutting-Edge Design
   Bento Box Layouts | Animated Gradients | Text Effects
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===========================================================================
   CSS VARIABLES
   =========================================================================== */

:root {
    /* Bold Color Palette */
    --pink: #ec4899;
    --purple: #8b5cf6;
    --orange: #f59e0b;
    --cyan: #06b6d4;
    --indigo: #6366f1;
    
    /* Gradient Combinations */
    --gradient-pink-purple: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --gradient-purple-orange: linear-gradient(135deg, #8b5cf6 0%, #f59e0b 100%);
    --gradient-cyan-indigo: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --gradient-mesh: 
        radial-gradient(at 20% 10%, var(--pink) 0px, transparent 50%),
        radial-gradient(at 80% 10%, var(--purple) 0px, transparent 50%),
        radial-gradient(at 50% 80%, var(--orange) 0px, transparent 50%),
        radial-gradient(at 90% 90%, var(--cyan) 0px, transparent 50%);
    
    /* Animated gradient for background */
    --gradient-animated: 
        linear-gradient(45deg, #ec4899, #8b5cf6, #f59e0b, #ec4899);
    
    /* Neutrals */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f1f5f9;
    --border: #e2e8f0;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Shadows with color tints */
    --shadow-pink: 0 10px 30px -5px rgba(236, 72, 153, 0.3);
    --shadow-purple: 0 10px 30px -5px rgba(139, 92, 246, 0.3);
    --shadow-orange: 0 10px 30px -5px rgba(245, 158, 11, 0.3);
}

/* ===========================================================================
   BASE RESET
   =========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================================================================
   BODY & ANIMATED BACKGROUND
   =========================================================================== */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gradient-animated);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2rem);
    position: relative;
    overflow-x: hidden;
}

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

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

body::before {
    width: 400px;
    height: 400px;
    background: var(--pink);
    top: -200px;
    left: -200px;
}

body::after {
    width: 300px;
    height: 300px;
    background: var(--cyan);
    bottom: -150px;
    right: -150px;
    animation-delay: -10s;
}

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

/* ===========================================================================
   CONTAINER - GLASSMORPHISM EFFECT
   =========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.85);
    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 rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 30px 60px -15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    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);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================================================
   HEADER - SPLIT DESIGN
   =========================================================================== */

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

/* Animated icon with rotation */
h1::before {
    content: '❓';
    display: block;
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1rem;
    animation: rotateScale 4s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(236, 72, 153, 0.3));
}

@keyframes rotateScale {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-10deg) scale(1.1);
    }
    75% {
        transform: rotate(10deg) scale(1.1);
    }
}

/* Bold heading with gradient text */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: var(--gradient-pink-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.375rem);
    color: var(--text-secondary);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

/* Animated underline */
.subtitle::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-purple-orange);
    border-radius: 2px;
    animation: expandWidth 2s ease-in-out infinite;
}

@keyframes expandWidth {
    0%, 100% {
        transform: scaleX(0.3);
    }
    50% {
        transform: scaleX(1);
    }
}

/* ===========================================================================
   STATS - BENTO BOX GRID
   =========================================================================== */

.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: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    border-radius: 1.5rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Gradient border on hover */
.stat::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    padding: 2px;
    background: var(--gradient-pink-purple);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Shimmer effect */
.stat::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shimmer 3s linear infinite;
    opacity: 0;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.stat:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-pink);
}

.stat:hover::before {
    opacity: 1;
}

.stat:hover::after {
    opacity: 1;
}

/* Different gradient for each stat */
.stat:nth-child(2):hover {
    box-shadow: var(--shadow-purple);
}

.stat:nth-child(3):hover {
    box-shadow: var(--shadow-orange);
}

.stat-value {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: var(--gradient-pink-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.stat:nth-child(2) .stat-value {
    background: var(--gradient-purple-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat:nth-child(3) .stat-value {
    background: var(--gradient-cyan-indigo);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* ===========================================================================
   NAVIGATION - BENTO GRID CARDS
   =========================================================================== */

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

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

/* Stagger animation */
li {
    animation: fadeInScale 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 fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===========================================================================
   QUESTION CARDS - BOLD DESIGN
   =========================================================================== */

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

/* Gradient background on hover */
a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-pink-purple);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
}

a:hover::before {
    opacity: 0.08;
}

/* Glow effect */
a::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1.25rem;
    padding: 2px;
    background: var(--gradient-pink-purple);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
}

a:hover,
a:focus-visible {
    transform: translateY(-6px) translateX(4px) rotate(1deg);
    box-shadow: var(--shadow-pink);
    border-color: transparent;
}

a:hover::after,
a:focus-visible::after {
    opacity: 1;
}

/* Alternate gradients for variety */
a:nth-child(2n)::after {
    background: var(--gradient-purple-orange);
}

a:nth-child(2n):hover {
    box-shadow: var(--shadow-purple);
}

a:nth-child(3n)::after {
    background: var(--gradient-cyan-indigo);
}

a:active {
    transform: translateY(-2px);
}

/* Number badge - geometric style */
.number {
    flex-shrink: 0;
    width: clamp(3rem, 6vw, 3.5rem);
    height: clamp(3rem, 6vw, 3.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-pink-purple);
    color: white;
    font-weight: 900;
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    position: relative;
    z-index: 1;
    animation: rotateBadge 10s linear infinite;
}

@keyframes rotateBadge {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

a:hover .number {
    animation-play-state: paused;
    transform: scale(1.1);
}

/* Alternate badge colors */
a:nth-child(2n) .number {
    background: var(--gradient-purple-orange);
}

a:nth-child(3n) .number {
    background: var(--gradient-cyan-indigo);
}

/* ===========================================================================
   LANGUAGE SWITCHER - FLOATING PILL
   =========================================================================== */

.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.95);
    backdrop-filter: blur(20px);
    padding: 0.875rem 1.25rem;
    border-radius: 3rem;
    box-shadow: var(--shadow-pink);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.language-switcher:hover {
    box-shadow: var(--shadow-purple);
    transform: translateY(-4px);
}

.lang-label {
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

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

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

/* ===========================================================================
   FOOTER
   =========================================================================== */

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

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    ul {
        grid-template-columns: 1fr;
    }
    
    .language-switcher {
        bottom: 1rem;
        right: 1rem;
        padding: 0.625rem 1rem;
    }
    
    .number {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 3rem;
    }
    
    .stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

/* ===========================================================================
   ACCESSIBILITY
   =========================================================================== */

:focus-visible {
    outline: 3px solid var(--pink);
    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;
    border-width: 0;
}

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

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #64748b;
    }
    
    .container {
        background: rgba(15, 23, 42, 0.85);
    }
    
    .stat,
    a {
        background: rgba(30, 41, 59, 0.8);
    }
}

/* Print */
@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-block h3::before {
    content: '🎰 ';
}

.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);
    }
}

/* MODERN: Кастомизация CTA для ярких цветов */
.cta-block {
    background: linear-gradient(135deg, var(--pink, #ec4899) 0%, var(--purple, #8b5cf6) 100%);
    box-shadow: 0 20px 40px rgba(236, 72, 153, 0.3);
}

.cta-button {
    color: var(--pink, #ec4899);
}

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

.lang-flag {
    background: rgba(255, 255, 255, 0.9);
}

.lang-flag.active {
    background: linear-gradient(135deg, var(--pink, #ec4899), var(--purple, #8b5cf6));
    border-color: transparent;
}
