/* ============================================
V-GURU VPN SERVICE — БАЗА ЗНАНИЙ (KB)
Версия: 4.1.1 | Дата: Март 2026
Файл: static/css/kb.css
============================================ */

/* ============================================
GLOBAL STYLES
============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.6;
    background-color: #f5f7fa;
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.06) 1px, transparent 1px);
    background-size: 50px 50px, 50px 50px;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ============================================
PARTICLES BACKGROUND (ПК только)
============================================ */
.particles-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.6) 0%, rgba(102, 126, 234, 0.2) 70%, transparent 100%);
    animation: particleFloat linear infinite;
}

.particle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.8);
    border-radius: 50%;
    animation: particlePulse 3s ease-in-out infinite;
}

.particle-1 { width: 80px; height: 80px; top: 10%; left: 15%; animation-duration: 55s; animation-delay: 0s; }
.particle-2 { width: 60px; height: 60px; top: 25%; left: 75%; animation-duration: 48s; animation-delay: -8s; }
.particle-3 { width: 100px; height: 100px; top: 55%; left: 35%; animation-duration: 62s; animation-delay: -16s; }
.particle-4 { width: 70px; height: 70px; top: 70%; left: 80%; animation-duration: 52s; animation-delay: -24s; }
.particle-5 { width: 90px; height: 90px; top: 40%; left: 90%; animation-duration: 58s; animation-delay: -32s; }
.particle-6 { width: 65px; height: 65px; top: 80%; left: 25%; animation-duration: 50s; animation-delay: -40s; }
.particle-7 { width: 75px; height: 75px; top: 15%; left: 50%; animation-duration: 54s; animation-delay: -48s; }
.particle-8 { width: 85px; height: 85px; top: 65%; left: 60%; animation-duration: 60s; animation-delay: -56s; }
.particle-9 { width: 55px; height: 55px; top: 35%; left: 10%; animation-duration: 46s; animation-delay: -5s; }
.particle-10 { width: 95px; height: 95px; top: 85%; left: 70%; animation-duration: 65s; animation-delay: -13s; }
.particle-11 { width: 60px; height: 60px; top: 50%; left: 5%; animation-duration: 51s; animation-delay: -21s; }
.particle-12 { width: 70px; height: 70px; top: 20%; left: 85%; animation-duration: 56s; animation-delay: -29s; }

@keyframes particleFloat {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(25px, -30px) scale(1.05); }
    50% { transform: translate(-15px, 20px) scale(0.95); }
    75% { transform: translate(20px, 25px) scale(1.02); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes particlePulse {
    0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
}

.particle-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    height: 1px;
    transform-origin: left center;
    animation: lineFlow 5s ease-in-out infinite;
}

.line-1 { width: 200px; top: 15%; left: 20%; transform: rotate(25deg); animation-delay: 0s; }
.line-2 { width: 180px; top: 30%; left: 60%; transform: rotate(-15deg); animation-delay: 1.5s; }
.line-3 { width: 220px; top: 60%; left: 40%; transform: rotate(35deg); animation-delay: 3s; }
.line-4 { width: 190px; top: 75%; left: 30%; transform: rotate(-25deg); animation-delay: 0.8s; }
.line-5 { width: 210px; top: 45%; left: 70%; transform: rotate(15deg); animation-delay: 2.3s; }
.line-6 { width: 170px; top: 20%; left: 45%; transform: rotate(-35deg); animation-delay: 4s; }
.line-7 { width: 230px; top: 80%; left: 50%; transform: rotate(45deg); animation-delay: 1.2s; }
.line-8 { width: 160px; top: 55%; left: 15%; transform: rotate(-45deg); animation-delay: 3.5s; }

@keyframes lineFlow {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
    animation: orbFloat 25s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.15) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation-delay: -12s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.18) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -6s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    33% { transform: translate(-45%, -55%) scale(1.08); }
    66% { transform: translate(-55%, -45%) scale(0.95); }
}

/* ============================================
HEADER
============================================ */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

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

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 80px;
    margin-bottom: 20px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

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

.header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.header p {
    font-size: 18px;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Home Button */
.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    margin-top: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ============================================
KB CONTENT SECTION
============================================ */
.kb-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 50px;
    color: #1a1a1a;
}

/* KB Grid — АДАПТИВНАЯ СЕТКА */
.kb-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

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

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

/* KB Card */
.kb-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 35px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kb-card:hover {
    transform: translateY(-8px);
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.kb-icon {
    font-size: 48px;
    display: block;
}

.kb-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.kb-card p {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
    flex-grow: 1;
}

.kb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: gap 0.3s;
}

.kb-link:hover { gap: 12px; }

/* CTA Block */
.kb-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    margin: 30px 0;
}

.kb-cta h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.kb-cta p {
    font-size: 16px;
    opacity: 0.95;
    margin-bottom: 20px;
	color: #ffffff;
}

.kb-cta-btn {
    display: inline-block;
    padding: 14px 32px;
    background: white;
    color: #667eea;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
}

.kb-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Footer */
.footer {
    background: rgba(30, 41, 59, 0.95);
    color: #cbd5e1;
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
    backdrop-filter: blur(10px);
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
}

.footer-links a:hover { color: white; }
.footer p { font-size: 14px; opacity: 0.8; }

/* ============================================
RESPONSIVE — МОБИЛЬНЫЕ (≤768px)
============================================ */
@media (max-width: 768px) {
    .header { padding: 50px 20px 30px; }
    .logo { font-size: 70px; }
    .header h1 { font-size: 28px; }
    .header p { font-size: 16px; }
    .section-title { font-size: 28px; }
    .kb-card { padding: 30px 25px; }
    .kb-icon { font-size: 42px; }
    .kb-card h3 { font-size: 19px; }
    .kb-cta { padding: 30px 20px; margin: 40px auto 0; }
    .kb-cta h3 { font-size: 20px; }
    .particles-container { display: none !important; }
}

/* ============================================
RESPONSIVE — ПК (≥1024px)
============================================ */
@media (min-width: 1024px) {
    .particles-container { display: block !important; }
    .kb-section { padding: 80px 0px; }
    .section-title { font-size: 36px; margin-bottom: 60px; }
    .kb-card { padding: 40px 35px; }
    .kb-card:hover { transform: translateY(-10px); }
    .kb-icon { font-size: 52px; }
    .kb-card h3 { font-size: 21px; }
    .header { padding: 50px 40px 40px; }
    .header h1 { font-size: 40px; }
    .header p { font-size: 19px; }
}

/* ============================================
KB ARTICLE STYLES (для страниц статей)
Добавлено: Март 2026
============================================ */

/* Article Container */
.kb-article {
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.kb-article-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.kb-article h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.kb-article-intro {
    font-size: 18px;
    color: #4b5563;
    line-height: 1.7;
}

/* Article Sections */
.kb-article-section {
    margin-bottom: 35px;
}

.kb-article-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.kb-article-section h3 {
    font-size: 20px;
    margin: 20px 0 10px;
    color: #1a1a1a;
}

.kb-article-section p {
    color: #4b5563;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.kb-article-section ul {
    list-style: none;
    padding-left: 0;
}

.kb-article-section li {
    padding: 8px 0 8px 25px;
    position: relative;
    color: #4b5563;
    font-size: 16px;
    line-height: 1.7;
}

.kb-article-section li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.kb-article-section ol {
    padding-left: 20px;
    color: #4b5563;
    line-height: 1.8;
}

.kb-article-section ol li {
    margin-bottom: 10px;
}

/* Note Box */
.kb-article-note {
    background: rgba(102, 126, 234, 0.08);
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.kb-article-note strong {
    color: #1a1a1a;
}

/* Diagram Box */
.kb-diagram {
    text-align: center !important;
    font-family: monospace;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    line-height: 2;
    word-break: break-all !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;  /* 🔧 ИЗМЕНИЛИ: было pre-wrap */
    display: block !important;
    max-width: 100%;
}

.kb-diagram br {
    display: block;
}

/* 🔧 ДОБАВЬТЕ это для центрирования */
.kb-diagram > * {
    text-align: center !important;
    display: block;
}

/* Code Inline */
.code-inline {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

/* Table - АДАПТИВНАЯ */
.kb-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.kb-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.kb-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 15px;
    color: #4b5563;
}

.kb-table tr:last-child td {
    border-bottom: none;
}

.kb-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Адаптивная таблица для мобильных */
@media (max-width: 768px) {
    .kb-table {
        display: block;
        border-radius: 8px;
    }
    .kb-table thead { display: none; }
    .kb-table tbody { display: block; }
    .kb-table tr {
        display: block;
        margin-bottom: 15px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        overflow: hidden;
    }
    .kb-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border-bottom: 1px solid #f1f5f9;
        font-size: 14px;
    }
    .kb-table td:last-child { border-bottom: none; }
    .kb-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #1a1a1a;
        margin-right: 15px;
    }
}

/* Final CTA */
.kb-final-cta {
    background: rgba(102, 126, 234, 0.08);
    border: 2px solid #667eea;
    padding: 35px;
    border-radius: 16px;
    text-align: center;
    margin-top: 40px;
}

.kb-final-cta h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.kb-final-cta p {
    font-size: 16px;
    color: #4b5563;
    margin-bottom: 20px;
}

.kb-final-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
}

.kb-final-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Navigation */
.kb-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.kb-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    transition: all 0.3s;
    background: rgba(102, 126, 234, 0.08);
}

.kb-nav a:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* Inline link in article */
.kb-link-inline {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.kb-link-inline:hover {
    text-decoration: underline;
}

/* Margin utility */
.mt-4 { margin-top: 20px; }

/* ============================================
RESPONSIVE — МОБИЛЬНЫЕ (≤768px) для статей
============================================ */
@media (max-width: 768px) {
    .kb-article { padding: 40px 20px; }
    .kb-article h1 { font-size: 26px; }
    .kb-article-intro { font-size: 16px; }
    .kb-article-section h2 { font-size: 22px; }
    .kb-final-cta { padding: 25px 20px; }
    .kb-final-cta h3 { font-size: 20px; }
    .kb-nav { flex-direction: column; }
    .kb-diagram { font-size: 14px; line-height: 1.8; }
}

/* ============================================
RESPONSIVE — ПК (≥1024px) для статей
============================================ */
@media (min-width: 1024px) {
    .kb-article { padding: 80px 0; }
    .kb-article h1 { font-size: 36px; }
    .kb-article-section h2 { font-size: 26px; }
}

/* ============================================
FIX: Специфичность для kb-cta внутри article
Добавлено: Март 2026
============================================ */

/* Когда kb-cta внутри kb-article-section */
.kb-article-section .kb-cta h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

/* Для kb-final-cta */
.kb-article-section .kb-final-cta h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

/* Когда kb-cta внутри kb-article-section */
.kb-article-section .kb-cta p {
    font-size: 16px;
    opacity: 0.95;
    margin-bottom: 20px;
	color: #ffffff;
}

/* Для kb-final-cta */
.kb-article-section .kb-final-cta p {
    color: #4b5563;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .kb-article { padding: 40px 20px; }
    .kb-article h1 { font-size: 26px; }
    .kb-article-intro { font-size: 16px; }
    .kb-article-section h2 { font-size: 22px; }
    .kb-final-cta { padding: 25px 20px; }
    .kb-final-cta h3 { font-size: 20px; }
    .kb-nav { flex-direction: column; }
    
    /* 🔧 ИЗМЕНИЛИ для мобильных */
    .kb-diagram { 
        font-size: 14px !important; 
        line-height: 1.6 !important;
        text-align: center !important;
        word-break: break-all !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;  /* 🔧 ИЗМЕНИЛИ: было pre-wrap */
        display: block !important;
        padding: 15px 10px !important;
    }
    
    .kb-diagram * {
        text-align: center !important;
    }
}

/* ============================================
NAVIGATION BUTTON STYLES (для kb_privacy)
Добавлено: Март 2026
============================================ */

.kb-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.08);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.kb-nav-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.kb-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.08);
    text-decoration: none;
    transition: all 0.3s;
}

.kb-nav-link:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .kb-nav-btn,
    .kb-nav-link {
        font-size: 14px;
        padding: 10px 16px;
    }
}