/* ========================================
   CSS ПЕРЕМЕННЫЕ ДЛЯ ТЕМ
======================================== */

:root[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: rgba(15, 15, 15, 0.95);
    --bg-card: rgba(220, 38, 38, 0.06);
    --bg-card-hover: rgba(220, 38, 38, 0.12);
    --text-primary: #e8e8e8;
    --text-secondary: #b8b8b8;
    --accent-primary: #dc2626;
    --accent-secondary: #b91c1c;
    --border-color: rgba(220, 38, 38, 0.2);
    --shadow-color: rgba(220, 38, 38, 0.15);
    --gradient-start: rgba(220, 38, 38, 0.08);
    --gradient-end: rgba(185, 28, 28, 0.08);
}

:root[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-card: rgba(220, 38, 38, 0.04);
    --bg-card-hover: rgba(220, 38, 38, 0.08);
    --text-primary: #2a2a2a;
    --text-secondary: #5a5a5a;
    --accent-primary: #dc2626;
    --accent-secondary: #b91c1c;
    --border-color: rgba(220, 38, 38, 0.15);
    --shadow-color: rgba(220, 38, 38, 0.1);
    --gradient-start: rgba(220, 38, 38, 0.05);
    --gradient-end: rgba(185, 28, 28, 0.05);
}

/* ========================================
   БАЗОВЫЕ СТИЛИ
======================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    width: 100%;
    position: relative;
    transition: background 0.5s ease, color 0.5s ease;
}

/* ========================================
   МИНИМАЛИСТИЧНЫЙ ПЕРЕКЛЮЧАТЕЛЬ ТЕМ
======================================== */

.theme-toggle-wrapper {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    display: flex;
    gap: 6px;
    align-items: center;
    background: transparent;
    padding: 0;
}

.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-toggle-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.theme-toggle-btn.active svg {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.sun-icon {
    animation: rotate-sun 20s linear infinite;
}

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

.moon-icon {
    animation: moon-glow 3s ease-in-out infinite;
}

@keyframes moon-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ========================================
   ШАПКА САЙТА
======================================== */

header {
    background: var(--bg-secondary);
    padding: 20px 0;
    box-shadow: 0 4px 20px var(--shadow-color);
    border-bottom: 2px solid var(--accent-primary);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.hidden {
    transform: translateY(-100%);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.logo {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    animation: glow-logo 3s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo .heart-icon {
    width: 36px;
    height: 36px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-primary));
    animation: heartbeat-logo 1.5s ease-in-out infinite;
}

@keyframes heartbeat-logo {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1); }
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px var(--accent-primary));
}

@keyframes glow-logo {
    0%, 100% { filter: drop-shadow(0 0 10px var(--accent-primary)); }
    50% { filter: drop-shadow(0 0 20px var(--accent-primary)); }
}

nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
}

nav ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-primary);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a.active {
    color: var(--accent-primary);
}

/* ========================================
   КОНТЕЙНЕР ПРАВИЛ
======================================== */

.rules-container {
    max-width: 1400px;
    margin: 100px auto 60px;
    padding: 40px;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* ========================================
   ЗАГОЛОВОК СТРАНИЦЫ (обновлено: стиль как на главной)
======================================== */

.page-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    transition: all 0.4s ease;
}

.page-header:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px var(--shadow-color);
}

/* Стили и анимации заголовка как на главной странице */
.heart-icon-title {
    width: 60px;
    height: 60px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 20px var(--accent-primary));
    animation: heartbeat-title 1.5s ease-in-out infinite;
    margin-right: 15px;
    flex-shrink: 0;
}

@keyframes heartbeat-title {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.15); }
    20%, 40% { transform: scale(1); }
}

/* Замените/перекройте существующий .page-header h1 этим */
.page-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 72px; /* при необходимости уменьшите (например 56px) */
    margin-bottom: 30px;
    text-shadow: 0 0 30px var(--accent-primary);
    animation: glow-title 2s ease-in-out infinite;
    line-height: 1.2;
    color: var(--text-primary);
}

/* glow-title (копия с главной) */
@keyframes glow-title {
    0%, 100% { text-shadow: 0 0 20px var(--accent-primary), 0 0 40px var(--shadow-color); }
    50% { text-shadow: 0 0 30px var(--accent-primary), 0 0 60px var(--shadow-color); }
}

.page-header p {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   ОГЛАВЛЕНИЕ
======================================== */

.table-of-contents {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 50px;
    border-left: 5px solid var(--accent-primary);
    position: sticky;
    top: 100px;
    z-index: 10;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.4s ease;
}

.table-of-contents:hover {
    box-shadow: 0 15px 40px var(--shadow-color);
}

.table-of-contents h2 {
    font-size: 24px;
    color: var(--accent-primary);
    margin-bottom: 20px;
    font-weight: bold;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin: 12px 0;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    display: block;
    padding: 8px 15px;
    border-radius: 8px;
}

.toc-list a:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    transform: translateX(10px);
}

/* ========================================
   СЕКЦИИ ПРАВИЛ
======================================== */

.rule-section {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    border: 2px solid var(--border-color);
    transition: all 0.4s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.rule-section:nth-child(1) { animation-delay: 0.1s; }
.rule-section:nth-child(2) { animation-delay: 0.2s; }
.rule-section:nth-child(3) { animation-delay: 0.3s; }
.rule-section:nth-child(4) { animation-delay: 0.4s; }
.rule-section:nth-child(5) { animation-delay: 0.5s; }

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

.rule-section:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px var(--shadow-color);
    transform: translateY(-5px);
}

.rule-section h2 {
    font-size: 32px;
    color: var(--accent-secondary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.rule-section h2 .section-number {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 6px 20px var(--shadow-color);
}

.rule-item {
    background: var(--bg-card-hover);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-primary);
    transition: all 0.3s ease;
}

.rule-item:hover {
    background: var(--bg-card);
    transform: translateX(5px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.rule-item h3 {
    color: var(--accent-primary);
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
}

.rule-item p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.rule-item ul {
    list-style: none;
    margin-top: 15px;
}

.rule-item ul li {
    color: var(--text-secondary);
    padding-left: 25px;
    position: relative;
    margin: 8px 0;
    font-size: 15px;
}

.rule-item ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

/* ========================================
   ПРИМЕРЫ И ПРЕДУПРЕЖДЕНИЯ
======================================== */

.examples-box {
    background: var(--bg-card-hover);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.examples-box:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.examples-box h4 {
    color: var(--accent-primary);
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.examples-box h4::before {
    content: '⚠️';
}

.examples-box ul {
    margin-left: 20px;
}

.examples-box ul li {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 5px 0;
}

/* ========================================
   БЛОК НАКАЗАНИЯ
======================================== */

.punishment-box {
    background: var(--bg-card-hover);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 6px 20px var(--shadow-color);
    transition: all 0.3s ease;
}

.punishment-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--shadow-color);
}

.punishment-box h4 {
    color: var(--accent-primary);
    font-size: 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.punishment-box h4::before {
    content: '⚖️';
    font-size: 24px;
}

.punishment-box p {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

/* ========================================
   ВАЖНЫЕ ЗАМЕТКИ
======================================== */

.note-box {
    background: rgba(59, 130, 246, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.note-box:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    transform: translateX(5px);
}

.note-box h4 {
    color: #60a5fa;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-box h4::before {
    content: 'ℹ️';
}

.note-box p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ========================================
   ИСКЛЮЧЕНИЯ
======================================== */

.exception-box {
    background: rgba(34, 197, 94, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #22c55e;
    transition: all 0.3s ease;
}

.exception-box:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
    transform: translateX(5px);
}

.exception-box h4 {
    color: #4ade80;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exception-box h4::before {
    content: '✅';
}

.exception-box p,
.exception-box ul li {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ========================================
   ФИНАЛЬНОЕ ПРЕДУПРЕЖДЕНИЕ
======================================== */

.final-warning {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-top: 60px;
    border: 3px solid var(--accent-primary);
    animation: warning-pulse 2s ease-in-out infinite;
    box-shadow: 0 15px 40px var(--shadow-color);
}

@keyframes warning-pulse {
    0%, 100% { 
        box-shadow: 0 15px 40px var(--shadow-color); 
        border-color: var(--accent-primary);
    }
    50% { 
        box-shadow: 0 20px 50px var(--shadow-color); 
        border-color: var(--accent-secondary);
    }
}

.final-warning h3 {
    font-size: 32px;
    color: var(--accent-primary);
    margin-bottom: 20px;
    text-shadow: 0 0 20px var(--shadow-color);
}

.final-warning p {
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========================================
   КНОПКА НАЗАД
======================================== */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px var(--shadow-color);
    margin-top: 40px;
}

.back-button:hover {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--shadow-color);
}

.back-button:active {
    transform: translateY(-1px);
}

/* ========================================
   ФУТЕР
======================================== */

footer {
    background: var(--bg-secondary);
    padding: 60px 40px 30px;
    text-align: center;
    border-top: 2px solid var(--accent-primary);
    position: relative;
    z-index: 1;
    width: 100%;
}

.footer-text {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 15px;
}

/* ========================================
   СКРОЛЛБАР
======================================== */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
}

/* ========================================
   ВЫДЕЛЕНИЕ ТЕКСТА
======================================== */

::selection {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ========================================
   УВЕДОМЛЕНИЯ
======================================== */

.notification {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    padding: 20px 35px;
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--shadow-color);
    transform: translateX(500px);
    transition: transform 0.4s ease;
    z-index: 10000;
    font-size: 16px;
    font-weight: bold;
    max-width: calc(100vw - 80px);
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
}

/* ========================================
   АДАПТИВ: ПЛАНШЕТЫ (768px - 1024px)
======================================== */

@media (max-width: 1024px) {
    nav {
        padding: 0 30px;
    }

    .logo {
        font-size: 32px;
    }

    .logo .heart-icon {
        width: 32px;
        height: 32px;
    }

    .rules-container {
        padding: 30px;
        margin-top: 90px;
    }

    .page-header h1 {
        font-size: 56px;
    }

    .page-header p {
        font-size: 18px;
    }

    .table-of-contents {
        position: static;
        top: auto;
    }

    .rule-section {
        padding: 30px;
    }

    .rule-section h2 {
        font-size: 28px;
    }

    .theme-toggle-wrapper {
        right: 15px;
        top: 90px;
    }

    .theme-toggle-btn {
        width: 34px;
        height: 34px;
    }

    .theme-toggle-btn svg {
        width: 17px;
        height: 17px;
    }

    .heart-icon-title {
        width: 55px;
        height: 55px;
        margin-right: 12px;
    }
}

/* ========================================
   АДАПТИВ: МОБИЛЬНЫЕ (до 768px)
======================================== */

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .logo {
        font-size: 28px;
    }

    .logo .heart-icon {
        width: 28px;
        height: 28px;
    }

    nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li a {
        font-size: 15px;
        padding: 8px 12px;
    }

    .rules-container {
        margin: 120}
    .rules-container {
        margin: 120px 20px 40px;
        padding: 20px;
    }

    .page-header {
        padding: 40px 16px;
        margin-bottom: 40px;
    }

    .page-header h1 {
        font-size: 42px;
    }

    .page-header p {
        font-size: 16px;
    }

    .rule-section {
        padding: 20px;
    }

    .table-of-contents {
        position: static;
        top: auto;
        margin-bottom: 30px;
    }

    .toc-list a {
        padding: 10px 12px;
    }

    .back-button {
        padding: 14px 30px;
        font-size: 16px;
    }
}

/* ========================================
   АДАПТИВ: МЕЛКИЕ ЭКРАНЫ (до 480px)
======================================== */

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    header {
        padding: 14px 0;
    }

    nav {
        padding: 10px 14px;
    }

    .logo {
        font-size: 22px;
    }

    .logo .heart-icon {
        width: 22px;
        height: 22px;
    }

    .rules-container {
        margin: 100px 12px 30px;
        padding: 14px;
    }

    .page-header {
        padding: 24px 12px;
        border-radius: 12px;
    }

    .page-header h1 {
        font-size: 26px;
        margin-bottom: 16px;
        text-align: center;
    }

    .heart-icon-title {
        width: 38px;
        height: 38px;
        margin-right: 8px;
    }

    .page-header p {
        font-size: 14px;
        max-width: 100%;
    }

    .table-of-contents {
        padding: 18px;
        border-radius: 10px;
    }

    .rule-section {
        padding: 18px;
        margin-bottom: 20px;
    }

    .rule-section h2 {
        font-size: 20px;
    }

    .rule-item h3 {
        font-size: 16px;
    }

    .rule-item p,
    .rule-item ul li {
        font-size: 14px;
    }

    .back-button {
        width: 100%;
        justify-content: center;
        padding: 14px 18px;
        font-size: 16px;
    }
}

/* ========================================
   ПЕЧАТЬ (опционально)
======================================== */

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }

    header, footer, .theme-toggle-wrapper, .notification {
        display: none !important;
    }

    .rules-container {
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .page-header {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 0 10px 0;
    }

    .page-header h1 {
        text-shadow: none;
        animation: none;
        font-size: 28px;
    }

    .heart-icon-title {
        display: inline-block;
        width: 24px;
        height: 24px;
        filter: none;
        animation: none;
    }

    .rule-section {
        border: none;
        box-shadow: none;
        padding: 0;
        margin-bottom: 10px;
    }

    .rule-item {
        background: transparent;
        border-left: 3px solid #000;
        padding: 8px 0;
    }
}

/* ========================================
   ЗАКЛЮЧИТЕЛЬНЫЕ ПРИМЕЧАНИЯ
   - Если у вас уже есть правила с такими же селекторами,
     разместите этот файл ниже них или удалите/замените старые
     правила, чтобы избежать конфликтов.
   - Переменные цвета (var(--accent-primary) и т.д.) находятся
     в начале файла и можно подправить под тему.
======================================== */
/* ========================================
   ВЫПАДАЮЩЕЕ МЕНЮ
======================================== */

.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    min-width: 220px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px var(--shadow-color);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    transform: translateX(4px);
}

.dropdown-item-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--border-color);
}

.dropdown-menu::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--bg-secondary);
}

/* Выравнивание пунктов */
nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
    align-items: center;
}

nav ul li {
    display: flex;
    align-items: center;
}

nav ul li a {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        transform: none;
        min-width: auto;
    }
    
    .dropdown:hover .dropdown-menu {
        transform: none;
    }
    
    .dropdown-menu::before,
    .dropdown-menu::after {
        display: none;
    }
}
/* ========================================
   ОБНОВЛЕННАЯ ШАПКА САЙТА
======================================== */

header {
    background: var(--bg-secondary);
    padding: 20px 0;
    box-shadow: 0 4px 20px var(--shadow-color);
    border-bottom: 2px solid var(--accent-primary);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.hidden {
    transform: translateY(-100%);
}

header:hover {
    box-shadow: 0 6px 30px var(--shadow-color);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

/* ========================================
   ЛОГОТИП С SVG СЕРДЦЕМ
======================================== */

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.heart-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-primary));
    transition: all 0.3s ease;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { 
        transform: scale(1); 
    }
    10%, 30% { 
        transform: scale(1.1); 
    }
    20%, 40% { 
        transform: scale(1); 
    }
}

.logo:hover .heart-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px var(--accent-primary));
}

.logo:hover {
    transform: scale(1.05);
}

/* ========================================
   НАВИГАЦИЯ
======================================== */

nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
}

nav ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-primary);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a.active {
    color: var(--accent-primary);
}

/* ========================================
   МИНИМАЛИСТИЧНЫЙ ПЕРЕКЛЮЧАТЕЛЬ ТЕМ
======================================== */

.theme-toggle-header {
    display: flex;
    gap: 6px;
    align-items: center;
    background: transparent;
    padding: 0;
}

.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-toggle-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.theme-toggle-btn.active svg {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Анимация иконок */
.sun-icon {
    animation: rotate-sun 20s linear infinite;
}

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

.moon-icon {
    animation: moon-glow 3s ease-in-out infinite;
}

@keyframes moon-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ========================================
   АДАПТИВ: ПЛАНШЕТЫ
======================================== */

@media (max-width: 1024px) {
    nav {
        padding: 0 30px;
    }

    .logo {
        font-size: 26px;
    }
    
    .heart-icon {
        width: 26px;
        height: 26px;
    }
    
    .theme-toggle-btn {
        width: 34px;
        height: 34px;
    }
    
    .theme-toggle-btn svg {
        width: 17px;
        height: 17px;
    }
}

/* ========================================
   АДАПТИВ: МОБИЛЬНЫЕ
======================================== */

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
        position: relative;
    }

    .logo {
        font-size: 24px;
    }
    
    .heart-icon {
        width: 24px;
        height: 24px;
    }

    nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li a {
        font-size: 15px;
    }
    
    /* Переключатель в правом верхнем углу на мобильных */
    .theme-toggle-header {
        position: absolute;
        top: 15px;
        right: 15px;
        gap: 5px;
    }
    
    .theme-toggle-btn {
        width: 32px;
        height: 32px;
    }
    
    .theme-toggle-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ========================================
   АДАПТИВ: МАЛЕНЬКИЕ МОБИЛЬНЫЕ
======================================== */

@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    
    .heart-icon {
        width: 20px;
        height: 20px;
    }

    nav ul li a {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .theme-toggle-header {
        top: 12px;
        right: 12px;
    }
    
    .theme-toggle-btn {
        width: 28px;
        height: 28px;
    }
    
    .theme-toggle-btn svg {
        width: 14px;
        height: 14px;
    }
}