/* === ОСНОВНЫЕ СТИЛИ === */
:root {
    --primary: #ff6b35;       /* Оранжевый - цвет сварочной дуги */
    --primary-dark: #e55a2b;
    --secondary: #2d3748;     /* Темный металл */
    --dark: #1a202c;          /* Фон */
    --metal: #4a5568;         /* Металлический серый */
    --light-metal: #718096;   /* Светлый металл */
    --spark: #ffd166;         /* Искры */
    --danger: #ef4444;        /* Предупреждения */
    --success: #10b981;       /* Успех */
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    background-attachment: fixed;
}

/* === НАВИГАЦИЯ СВАРОЧНАЯ === */
.navbar {
    background: rgba(26, 32, 44, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.1);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.8rem;
    background: linear-gradient(45deg, var(--primary), var(--spark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.nav-link {
    position: relative;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 107, 53, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(45deg, var(--primary), transparent);
    color: white !important;
}

/* === КАРТОЧКИ В СТИЛЕ МЕТАЛЛА === */
.card {
    background: linear-gradient(145deg, rgba(45, 55, 72, 0.9), rgba(26, 32, 44, 0.9));
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 12px;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    transition: left 0.6s ease;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow:
        0 15px 35px rgba(255, 107, 53, 0.2),
        0 5px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card:hover::before {
    left: 100%;
}

.card-header {
    background: linear-gradient(90deg, rgba(45, 55, 72, 0.9), rgba(26, 32, 44, 0.9));
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === КНОПКИ В СТИЛЕ СВАРКИ === */
.btn {
    border: none;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--primary-dark), var(--primary));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.3);
}

/* === ФОРМЫ С МЕТАЛЛИЧЕСКИМ ЭФФЕКТОМ === */
.form-control, .form-select {
    background: rgba(26, 32, 44, 0.7);
    border: 2px solid rgba(255, 107, 53, 0.3);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: rgba(26, 32, 44, 0.9);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    color: white;
    transform: translateY(-2px);
}

.form-label {
    font-weight: 600;
    color: #cbd5e0;
    margin-bottom: 0.5rem;
}

/* === СПЕЦИАЛЬНЫЕ ЭФФЕКТЫ ДЛЯ ТЕМЫ === */
.welding-spark {
    position: relative;
    overflow: hidden;
}

.welding-spark::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 209, 102, 0.1) 0%, transparent 70%);
    animation: sparkle 3s infinite;
}

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

.metal-texture {
    background: linear-gradient(45deg,
        rgba(255, 255, 255, 0.05) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.05) 75%,
        transparent 75%,
        transparent);
    background-size: 20px 20px;
}

/* === ГЕРОЙ СЕКЦИЯ НА ГЛАВНОЙ === */
.hero-section {
    background: linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.9)),
                url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwMCIgaGVpZ2h0PSI2MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNLTQwIDQwMEMxNjAgMCA0MDAgNDAwIDYwMCAyMDBTNjAwIDQwMCA4NDAgNDAwYzI0MCAwIDM2MC0xNjAgNjAwLTE2MHY0MDBILTQweiIgZmlsbD0iIzBmMTcyYSIvPjwvZz48L3N2Zz4=');
    background-size: cover;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 107, 53, 0.05), transparent);
}

/* === ТАБЛИЦЫ В СПРАВОЧНИКЕ === */
.table {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.table thead th {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 107, 53, 0.1);
}

.table tbody tr:hover {
    background: rgba(255, 107, 53, 0.1);
    transform: scale(1.01);
}

.table td {
    padding: 1rem;
    border-color: rgba(255, 107, 53, 0.1);
    vertical-align: middle;
}

/* === АККОРДЕОН В СПРАВОЧНИКЕ === */
.accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-border-color: rgba(255, 107, 53, 0.2);
    --bs-accordion-btn-color: #e2e8f0;
    --bs-accordion-btn-bg: rgba(45, 55, 72, 0.7);
}

.accordion-button {
    background: linear-gradient(90deg, rgba(45, 55, 72, 0.9), rgba(26, 32, 44, 0.9)) !important;
    font-weight: 600;
    border-radius: 8px !important;
    margin-bottom: 5px;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark)) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.accordion-button::after {
    filter: brightness(0) invert(1);
}

/* === ИКОНКИ СВАРОЧНЫЕ === */
.welding-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
}

.welding-icon i {
    font-size: 1.8rem;
    color: white;
}

.card:hover .welding-icon {
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
}

/* === ФУТЕР === */
footer {
    background: rgba(15, 23, 42, 0.9);
    border-top: 2px solid var(--primary);
    margin-top: 4rem;
    padding: 3rem 0;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* === АНИМАЦИИ === */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* === ЗАГОЛОВКИ === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    background: linear-gradient(45deg, #e2e8f0, #cbd5e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === ПРОГРЕСС БАР ДЛЯ ТЕСТА === */
.progress {
    background: rgba(26, 32, 44, 0.7);
    border: 1px solid rgba(255, 107, 53, 0.3);
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--spark));
    border-radius: 10px;
}

/* === КАСТОМНЫЕ ЧЕКБОКСЫ И РАДИО === */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1.5rem;
    }

    .hero-section {
        padding: 2rem 1rem !important;
    }

    .table-responsive {
        font-size: 0.9rem;
    }
}

/* === ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ === */
.glow {
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.metal-badge {
    background: linear-gradient(45deg, var(--metal), var(--light-metal));
    color: white;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Анимация искр */
@keyframes sparkMove {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
        background: radial-gradient(circle, #ffd166, transparent);
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * var(--distance)),
            calc(sin(var(--angle)) * var(--distance))
        ) scale(0);
        opacity: 0;
    }
}

.spark {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeInUp 0.6s ease forwards;
}

/* Параллакс эффект */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Неоновый эффект для важных элементов */
.neon {
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 15px #fff,
        0 0 20px #ff6b35,
        0 0 35px #ff6b35,
        0 0 40px #ff6b35,
        0 0 50px #ff6b35,
        0 0 75px #ff6b35;
}

/* Анимация загрузки */
.loading-spark {
    width: 40px;
    height: 40px;
    position: relative;
}

.loading-spark::before,
.loading-spark::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, var(--primary));
    animation: rotate 1s linear infinite;
}

.loading-spark::after {
    filter: blur(10px);
}

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

/* === ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ СТРАНИЦ === */

/* Футер */
.footer {
    background: rgba(15, 23, 42, 0.9);
    border-top: 2px solid rgba(255, 107, 53, 0.3);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.footer-text {
    color: #94a3b8;
    line-height: 1.6;
}

.footer-title {
    color: white;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #ff6b35;
    padding-left: 5px;
}

.footer-contacts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contacts li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #94a3b8;
}

.footer-contacts i {
    color: #ff6b35;
    width: 20px;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

.footer-bottom {
    color: #64748b;
    font-size: 0.9rem;
}

.footer-link {
    color: #64748b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #ff6b35;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b35;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #ff6b35;
    color: white;
    transform: translateY(-3px);
}

/* Анимации фона */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
}

.spark {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffd166;
    border-radius: 50%;
    animation: sparkFloat 15s infinite linear;
}

.spark:nth-child(2) {
    animation-delay: 5s;
}

.spark:nth-child(3) {
    animation-delay: 10s;
}

@keyframes sparkFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Навигация */
.navbar {
    background: linear-gradient(90deg, rgba(26, 32, 44, 0.95), rgba(45, 55, 72, 0.95));
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
}

.brand-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    color: white;
}

.brand-accent {
    color: #ff6b35;
}

.nav-link {
    color: #cbd5e0 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff6b35, #ffd166);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link.active {
    background: rgba(255, 107, 53, 0.1);
    color: white !important;
}

.nav-link.active::before {
    width: 80%;
}

/* Адаптивность */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }

    .hero-section, .page-hero, .handbook-hero, .guide-hero {
        padding: 2rem 0;
    }

    .welding-methods {
        flex-direction: column;
        align-items: center;
    }

    .method-icon {
        width: 100%;
        max-width: 200px;
    }

    .table-responsive {
        font-size: 0.85rem;
    }
}

/* Утилиты */
.text-gradient {
    background: linear-gradient(45deg, #ff6b35, #ffd166);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* === ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ТЕСТА === */

/* Анимация для правильных/неправильных ответов */
@keyframes correctAnswer {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes incorrectAnswer {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.option-item.correct {
    animation: correctAnswer 0.5s ease;
}

.option-item.incorrect {
    animation: incorrectAnswer 0.5s ease;
}

/* Стили для печати результатов */
@media print {
    .navbar, .footer, .quiz-navigation,
    .quiz-progress, #finishQuiz, .section.bg-dark,
    .study-card .btn, .mistake-card {
        display: none !important;
    }

    .quiz-results {
        display: block !important;
        margin: 0;
        padding: 0;
    }

    .results-card {
        border: none;
        box-shadow: none;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .text-gradient, .result-score {
        color: black !important;
        background: none !important;
        -webkit-text-fill-color: black !important;
    }
}

/* Стили для темной темы в результатах */
.dark-theme-results {
    background: #1a202c;
    color: #e2e8f0;
}

.dark-theme-results .result-score {
    background: linear-gradient(45deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Загрузочный экран для теста */
.quiz-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 32, 44, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.quiz-loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Категории вопросов */
.question-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-left: 1rem;
}

/* Подсказки к вопросам */
.question-hint {
    background: rgba(255, 209, 102, 0.1);
    border-left: 4px solid #ffd166;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #fef3c7;
}

/* Рейтинг сложности вопроса */
.question-difficulty {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 1rem;
}

.difficulty-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4a5568;
}

.difficulty-dot.active {
    background: #10b981;
}