/* ===========================================================================
   DEFAULT TEMPLATE V6 - "Classic Pro"
   Professional, Trustworthy, Timeless Design
   Mobile-First | Accessible | Performance-Optimized
   =========================================================================== */

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

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

:root {
    /* Colors - HSL for easy manipulation */
    --primary-h: 239;
    --primary-s: 84%;
    --primary-l: 67%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-dark: hsl(var(--primary-h), var(--primary-s), 57%);
    --primary-light: hsl(var(--primary-h), var(--primary-s), 77%);
    --primary-lightest: hsl(var(--primary-h), var(--primary-s), 95%);
    
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Neutrals */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border: #e2e8f0;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-mesh: 
        radial-gradient(at 0% 0%, hsl(239, 84%, 67%) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsl(271, 77%, 71%) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsl(186, 78%, 60%) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsl(239, 84%, 67%) 0px, transparent 50%);
}

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

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

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

/* Respect reduced motion */
@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;
    }
}

/* ===========================================================================
   BODY & LAYOUT
   =========================================================================== */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gradient-mesh), var(--bg-secondary);
    background-attachment: fixed;
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2rem);
}

/* Animated background on scroll */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===========================================================================
   CONTAINER
   =========================================================================== */

.container {
    max-width: 960px;
    margin: 0 auto;
    background: var(--bg-primary);
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: clamp(1rem, 2vw, 2rem);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Decorative elements */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2rem 2rem 0 0;
}

/* ===========================================================================
   HEADER
   =========================================================================== */

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

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Icon emoji */
h1::before {
    content: '❓';
    display: block;
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

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

h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

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

/* ===========================================================================
   STATS SECTION
   =========================================================================== */

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

.stat {
    text-align: center;
    padding: clamp(1rem, 2vw, 1.5rem);
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

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

.stat-value {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ===========================================================================
   NAVIGATION / QUESTIONS LIST
   =========================================================================== */

nav {
    margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

ul {
    list-style: none;
    display: grid;
    gap: clamp(0.75rem, 2vw, 1rem);
}

li {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

/* Stagger animation */
li:nth-child(1) { animation-delay: 0.1s; }
li:nth-child(2) { animation-delay: 0.15s; }
li:nth-child(3) { animation-delay: 0.2s; }
li:nth-child(4) { animation-delay: 0.25s; }
li:nth-child(5) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================================================
   QUESTION CARDS
   =========================================================================== */

a {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    padding: clamp(1rem, 3vw, 1.5rem);
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    line-height: 1.5;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 60px; /* Touch target */
}

/* Gradient border effect */
a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 2px;
    background: var(--gradient-primary);
    -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.25s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover,
a:focus-visible {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 20px -5px rgba(99, 102, 241, 0.2),
        0 0 0 3px rgba(99, 102, 241, 0.1);
    border-color: transparent;
}

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

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

/* Number badge */
.number {
    flex-shrink: 0;
    width: clamp(2rem, 5vw, 2.75rem);
    height: clamp(2rem, 5vw, 2.75rem);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ===========================================================================
   LANGUAGE SWITCHER
   =========================================================================== */

.language-switcher {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

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

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

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

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

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

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

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

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

@media (min-width: 1024px) {
    body {
        padding: 2rem;
    }
    
    .container {
        padding: 4rem;
    }
    
    /* Add parallax effect on desktop */
    body {
        background-attachment: fixed;
    }
}

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

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

/* Screen reader only */
.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;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    a {
        border-width: 3px;
    }
    
    .stat {
        border-width: 2px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #64748b;
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --border: #334155;
    }
    
    .container {
        box-shadow: 
            0 25px 50px -12px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }
}

/* ===========================================================================
   PRINT STYLES
   =========================================================================== */

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        padding: 1rem;
    }
    
    .language-switcher {
        display: none;
    }
    
    a {
        page-break-inside: avoid;
    }
}

/* ===========================================================================
   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);
    }
}
