/* ===========================================================================
   MODERN TEMPLATE V6 - PAGE.CSS
   Individual Question/Answer Page - Bold Contemporary
   Geometric Design | Animated Elements | Text Gradients
   =========================================================================== */

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

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

:root {
    /* Bold Colors */
    --pink: #ec4899;
    --purple: #8b5cf6;
    --orange: #f59e0b;
    --cyan: #06b6d4;
    --indigo: #6366f1;
    --green: #10b981;
    
    /* Gradients */
    --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%);
    
    /* Neutrals */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --border: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-pink: 0 10px 30px -5px rgba(236, 72, 153, 0.3);
}

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

* {
    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 - ANIMATED BACKGROUND
   =========================================================================== */

body {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.7;
    color: var(--text-primary);
    background: linear-gradient(45deg, #ec4899, #8b5cf6, #f59e0b, #ec4899);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    max-width: 1000px;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
    position: relative;
}

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

/* ===========================================================================
   BREADCRUMB
   =========================================================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    box-shadow: var(--shadow-md);
}

.breadcrumb a {
    color: var(--pink);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

.breadcrumb a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-pink-purple);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.breadcrumb a:hover::after {
    transform: scaleX(1);
}

.breadcrumb-separator {
    color: var(--text-tertiary);
    font-weight: 700;
}

.breadcrumb-current {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===========================================================================
   ARTICLE - GLASSMORPHISM CONTAINER
   =========================================================================== */

article {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-xl);
    padding: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 2rem;
    position: relative;
    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);
    }
}

/* Gradient top border */
article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-pink-purple);
    border-radius: 2rem 2rem 0 0;
}

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

article header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid transparent;
    border-image: var(--gradient-pink-purple) 1;
}

article h1::before {
    content: '❓';
    display: inline-block;
    margin-right: 0.75rem;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    animation: rotatePulse 4s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(236, 72, 153, 0.4));
}

@keyframes rotatePulse {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(10deg) scale(1.1);
    }
}

article h1 {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: var(--gradient-pink-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================================================================
   META
   =========================================================================== */

.meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: var(--text-secondary);
    font-weight: 600;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===========================================================================
   ANSWER CONTENT
   =========================================================================== */

.answer {
    font-size: clamp(1.0625rem, 2vw, 1.1875rem);
    line-height: 1.8;
    color: var(--text-primary);
}

.answer p {
    margin-bottom: 1.5rem;
}

.answer h2 {
    font-size: clamp(1.625rem, 3vw, 2.125rem);
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-purple-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    padding-left: 1.25rem;
}

.answer h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.375rem;
    bottom: 0.375rem;
    width: 4px;
    background: var(--gradient-purple-orange);
    border-radius: 2px;
}

.answer h3 {
    font-size: clamp(1.375rem, 2.5vw, 1.75rem);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.answer ul,
.answer ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.answer ul {
    list-style: none;
}

.answer ul li {
    position: relative;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.answer ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--pink);
    font-weight: 900;
    font-size: 1.25rem;
}

.answer ol li {
    margin-bottom: 1rem;
}

.answer ol li::marker {
    color: var(--purple);
    font-weight: 800;
}

.answer a {
    color: var(--pink);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid var(--pink);
    transition: all 0.2s ease;
}

.answer a:hover {
    color: var(--purple);
    border-bottom-color: var(--purple);
}

.answer strong {
    font-weight: 800;
    background: var(--gradient-pink-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.answer code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(139, 92, 246, 0.1));
    padding: 0.25em 0.5em;
    border-radius: 0.375rem;
    color: var(--pink);
    font-weight: 600;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.answer blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 6px solid var(--pink);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), rgba(139, 92, 246, 0.05));
    border-radius: 0 1rem 1rem 0;
    font-style: italic;
    font-size: 1.125em;
    color: var(--text-secondary);
}

/* ===========================================================================
   KEY TAKEAWAYS - BOLD BOX
   =========================================================================== */

.key-takeaways {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(139, 92, 246, 0.1));
    border: 3px solid transparent;
    border-image: var(--gradient-pink-purple) 1;
    border-radius: 1.5rem;
    padding: 2rem;
    margin: 2.5rem 0;
    position: relative;
}

.key-takeaways::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-pink-purple);
    border-radius: 1.5rem 1.5rem 0 0;
}

.key-takeaways h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.key-takeaways h3::before {
    content: '💡';
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.key-takeaways ul {
    list-style: none;
    padding: 0;
}

.key-takeaways li {
    padding: 1rem 0 1rem 2.5rem;
    position: relative;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.key-takeaways li:last-child {
    border-bottom: none;
}

.key-takeaways li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 900;
    font-size: 1.5rem;
    animation: checkPop 0.5s ease-in-out backwards;
}

.key-takeaways li:nth-child(1)::before { animation-delay: 0.1s; }
.key-takeaways li:nth-child(2)::before { animation-delay: 0.2s; }
.key-takeaways li:nth-child(3)::before { animation-delay: 0.3s; }

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===========================================================================
   CTA - BOLD & ANIMATED
   =========================================================================== */

.cta {
    background: var(--gradient-pink-purple);
    color: white;
    border-radius: 1.5rem;
    padding: clamp(2rem, 5vw, 3rem);
    margin: 3rem 0;
    text-align: center;
    box-shadow: var(--shadow-pink);
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 70%
    );
    animation: shimmer 3s linear infinite;
}

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

.cta h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.cta p {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    margin-bottom: 2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: white;
    color: var(--pink);
    font-weight: 800;
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    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: 56px;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.cta-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.4);
}

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

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

/* ===========================================================================
   RELATED QUESTIONS
   =========================================================================== */

.related-questions {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.related-questions h2 {
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.related-questions h2::before {
    content: '🔗';
    font-size: 2rem;
}

.related-questions ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.related-questions a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 64px;
}

.related-questions a::before {
    content: '▸';
    font-size: 1.5rem;
    color: var(--pink);
    font-weight: 900;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.related-questions a:hover {
    transform: translateX(8px);
    border-color: var(--pink);
    background: rgba(255, 255, 255, 1);
    box-shadow: var(--shadow-md);
}

.related-questions a:hover::before {
    transform: translateX(4px);
}

/* ===========================================================================
   BACK BUTTON
   =========================================================================== */

.back-to-index {
    margin-top: 2rem;
    text-align: center;
}

.back-to-index a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--pink);
    font-weight: 700;
    text-decoration: none;
    border: 3px solid var(--pink);
    border-radius: 3rem;
    transition: all 0.3s ease;
    min-height: 56px;
}

.back-to-index a::before {
    content: '←';
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.back-to-index a:hover {
    background: var(--gradient-pink-purple);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: var(--shadow-pink);
}

.back-to-index a:hover::before {
    transform: translateX(-4px);
}

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

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

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

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

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }
    
    article {
        padding: 1.5rem;
    }
    
    .language-switcher {
        bottom: 1rem;
        right: 1rem;
    }
}

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

@media (prefers-contrast: high) {
    article,
    .related-questions {
        border-width: 3px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --bg-primary: #0f172a;
    }
    
    article {
        background: rgba(15, 23, 42, 0.9);
    }
}

@media print {
    body {
        background: white;
        animation: none;
    }
    
    .language-switcher,
    .cta,
    .back-to-index {
        display: none;
    }
}

/* ===========================================================================
   CTA SECTION (Call-to-Action Block) для PAGE
   =========================================================================== */

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

/* ===========================================================================
   TABLE OF CONTENTS (On This Page)
   =========================================================================== */

.table-of-contents {
    background: var(--bg-secondary, #f8fafc);
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.table-of-contents h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-of-contents ol {
    list-style: none;
    counter-reset: toc-counter;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    counter-increment: toc-counter;
    margin-bottom: 0.5rem;
}

.table-of-contents li::before {
    content: counter(toc-counter) ". ";
    color: var(--primary, #6366f1);
    font-weight: 700;
}

.table-of-contents a {
    color: var(--primary, #6366f1);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.table-of-contents a:hover {
    color: var(--secondary, #8b5cf6);
    text-decoration: underline;
}

/* ===========================================================================
   RESPONSIVE для Page
   =========================================================================== */

@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;
    }
    
    .table-of-contents {
        padding: 1rem;
    }
}

@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);
    }
    
    .table-of-contents {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* MODERN: Кастомизация для ярких цветов */
.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.active {
    background: linear-gradient(135deg, var(--pink, #ec4899), var(--purple, #8b5cf6));
    border-color: transparent;
}

.table-of-contents {
    background: rgba(236, 72, 153, 0.05);
    border-color: rgba(236, 72, 153, 0.2);
}

.table-of-contents a {
    color: var(--pink, #ec4899);
}
