/* /* style.css - Полные стили для сайта ПДД-24.рф */

/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
    /* Светлая тема (по умолчанию) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-sidebar: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --accent-primary: #2563eb;
    --accent-secondary: #3b82f6;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --accent-soft: #eff6ff;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    --sign-bg: #ffffff;
    --sign-border: #e2e8f0;
    --code-bg: #f1f5f9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

/* Тёмная тема */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-hover: #2563eb;
    --accent-light: #1e3a8a;
    --accent-soft: #0f172a;
    --border-color: #334155;
    --border-strong: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --sign-bg: #ffffff;
    --sign-border: #475569;
    --code-bg: #334155;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
}

/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.2s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===== */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-light);
}

.theme-btn i {
    font-size: 24px;
    color: var(--text-primary);
}

[data-theme="light"] .fa-sun {
    display: block;
    color: #f59e0b;
}

[data-theme="light"] .fa-moon {
    display: none;
}

[data-theme="dark"] .fa-sun {
    display: none;
}

[data-theme="dark"] .fa-moon {
    display: block;
    color: #94a3b8;
}

/* ===== ШАПКА ===== */
.header {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    background-color: rgba(var(--bg-card-rgb), 0.95);
}

.logo {
    padding: 20px 0;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-highlight {
    color: var(--accent-primary);
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.last-update {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.last-update i {
    color: var(--accent-primary);
}

.update-badge {
    background: var(--accent-light);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-size: 1rem;
}

.main-nav a:hover {
    color: var(--accent-primary);
}

.main-nav a.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* ===== ОСНОВНЫЕ СЕКЦИИ ===== */
.section {
    padding: 40px 0;
    flex: 1;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

.title-badge {
    background: var(--accent-light);
    color: var(--accent-primary);
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    margin-left: 15px;
}

/* ===== ЛЕЙАУТ ПДД ===== */
.pdd-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    position: relative;
}

/* Боковое меню */
.pdd-sidebar {
    background: var(--bg-sidebar);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    height: fit-content;
    border: 1px solid var(--border-color);
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

.sticky-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sticky-sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.sticky-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.sidebar-header h3 i {
    color: var(--accent-primary);
}

/* Поиск */
.search-box {
    position: relative;
    margin-top: 10px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Содержание */
.pdd-toc {
    padding: 10px 0;
}

.pdd-toc ul {
    list-style: none;
}

.toc-chapter {
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.toc-chapter:last-child {
    border-bottom: none;
}

.chapter-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s;
    background: var(--bg-sidebar);
}

.chapter-link:hover {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.chapter-link.active {
    background: var(--accent-light);
    color: var(--accent-primary);
    border-left: 4px solid var(--accent-primary);
}

.chapter-num {
    min-width: 70px;
    color: var(--accent-primary);
    font-weight: 700;
}

.chapter-title {
    flex: 1;
    font-size: 0.95rem;
}

.toggle-submenu {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.toggle-submenu:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.toc-items {
    display: none;
    background: var(--bg-card);
    padding: 5px 0;
}

.toc-chapter.expanded .toc-items {
    display: block;
}

.toc-chapter.expanded .toggle-submenu i {
    transform: rotate(180deg);
}

.toc-items li a {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 50px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.toc-items li a:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

.toc-items li a.active {
    background: var(--accent-soft);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 500;
}

.item-num {
    min-width: 45px;
    color: var(--text-muted);
    font-family: monospace;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.sidebar-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.sidebar-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Основной контент */
.pdd-content {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 30px;
    border: 1px solid var(--border-color);
    min-height: 600px;
}

.pdd-chapter {
    margin-bottom: 40px;
    scroll-margin-top: 120px;
}

.pdd-chapter:last-child {
    margin-bottom: 0;
}

.chapter-heading {
    font-size: 1.8rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-primary);
}

.chapter-badge {
    background: var(--accent-primary);
    color: white;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
}

/* Элементы ПДД */
.pdd-item {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    scroll-margin-top: 120px;
}

.pdd-item:target {
    border-left: 4px solid var(--accent-primary);
    background: var(--accent-soft);
}

.item-heading {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.item-number {
    background: var(--accent-primary);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 1rem;
    font-family: monospace;
}

.item-short-title {
    color: var(--text-secondary);
    font-weight: normal;
}

.change-badge {
    background: var(--warning);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.change-badge i {
    font-size: 0.9rem;
}

.item-content {
    color: var(--text-secondary);
    font-size: 1rem;
}

.item-content p {
    margin-bottom: 10px;
}

.item-content p:last-child {
    margin-bottom: 0;
}

.item-footnote {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px dashed var(--border-color);
}

.footnote-mark {
    color: var(--accent-primary);
    font-weight: bold;
}

/* Подпункты */
.item-subitems {
    margin-top: 15px;
}

.subitem {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.subitem:last-child {
    margin-bottom: 0;
}

.subitem-heading {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--accent-primary);
    font-family: monospace;
}

.subitem-content {
    color: var(--text-secondary);
}

.subitem-content p {
    margin-bottom: 8px;
}

/* Списки */
.simple-list {
    margin: 10px 0 10px 20px;
    color: var(--text-secondary);
}

.simple-list li {
    margin-bottom: 5px;
}

.simple-list ul {
    margin-left: 20px;
    margin-top: 5px;
}

/* Иконки знаков */
.sign-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0 2px;
    padding: 2px 5px;
    background: var(--bg-card);
    border: 1px solid var(--sign-border);
    border-radius: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

.sign-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: inline-block;
    background: var(--sign-bg);
    border-radius: 4px;
}

.sign-number {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

.sign-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Кнопка "Наверх" */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 99;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
}

/* Футер */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.disclaimer {
    font-size: 0.85rem;
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* ===== СТИЛИ ДЛЯ БЛОКА ШТРАФОВ ===== */
.item-fines {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    border-left: 4px solid var(--danger);
    box-shadow: var(--shadow-sm);
}

.subitem-fines {
    margin-top: 15px;
    margin-bottom: 5px;
}

.fines-title {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fines-title i {
    font-size: 1.1rem;
}

.fine-card {
    padding: 12px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.fine-card:last-child {
    margin-bottom: 0;
}

.fine-article {
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.fine-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.fine-amount {
    font-weight: 600;
    color: var(--danger);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.fine-amount i {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.fine-note {
    margin-top: 12px;
    padding: 10px;
    background: var(--accent-soft);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px dashed var(--accent-primary);
}

.fine-note i {
    color: var(--accent-primary);
    font-size: 1.1rem;
    margin-top: 2px;
}

/* ===== СТРАНИЦЫ "О САЙТЕ", "КОНТАКТЫ", "ПОЛИТИКА" ===== */
.page-section {
    padding: 60px 0;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.about-card h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-card h2 i {
    color: var(--accent-primary);
}

.about-card h3 {
    font-size: 1.4rem;
    margin: 30px 0 20px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-light);
}

.about-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.feature-item {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-item i {
    font-size: 2.2rem;
    color: var(--accent-primary);
    margin-bottom: 15px;
}

.feature-item h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-item p {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: var(--text-secondary);
}

.about-note {
    margin-top: 30px;
    padding: 20px;
    background: var(--accent-soft);
    border-radius: 12px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    border-left: 4px solid var(--accent-primary);
}

.about-note i {
    font-size: 1.5rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.about-note p {
    margin-bottom: 0;
    color: var(--text-primary);
}

/* Контакты */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.contact-card {
    background: var(--bg-secondary);
    padding: 30px 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.contact-card i {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 15px;
}

.contact-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.contact-card a {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
}

.contact-card a:hover {
    text-decoration: underline;
}

.contact-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Форма обратной связи */
.feedback-form {
    margin-top: 40px;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.feedback-form h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.submit-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.form-note {
    text-align: center;
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Политика конфиденциальности */
.privacy-content h2 {
    font-size: 1.5rem;
    margin: 30px 0 15px;
    color: var(--text-primary);
}

.privacy-content h2:first-child {
    margin-top: 0;
}

.privacy-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.7;
}

.privacy-content ul {
    margin: 15px 0 15px 25px;
    color: var(--text-secondary);
}

.privacy-content li {
    margin-bottom: 8px;
}

.privacy-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px dashed var(--border-color);
    text-align: center;
    color: var(--text-muted);
}

.privacy-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.privacy-footer a:hover {
    text-decoration: underline;
}

/* ===== СТРАНИЦА ДОРОЖНЫХ ЗНАКОВ (SIGNS.HTML) ===== */
.signs-page {
    padding: 40px 0 60px;
}

.signs-intro {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    background: var(--bg-secondary);
    padding: 20px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Навигация по группам знаков */
.signs-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 60px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.category-link {
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
}

.category-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Цветовые схемы для категорий */
.warning-bg {
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: white;
}

.warning-bg:hover {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.priority-bg {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.priority-bg:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.prohibitory-bg {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.prohibitory-bg:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.mandatory-bg {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.mandatory-bg:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.special-bg {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.special-bg:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.info-bg {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.info-bg:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.service-bg {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: white;
}

.service-bg:hover {
    background: linear-gradient(135deg, #e11d48, #be123c);
}

.additional-bg {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.additional-bg:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
}

/* Группы знаков */
.signs-group {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
    background: var(--bg-card);
    border-radius: 32px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.signs-group:hover {
    box-shadow: var(--shadow-xl);
}

.group-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid transparent;
    position: relative;
}

.group-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-md);
}

.group-badge.warning {
    background: linear-gradient(135deg, #f97316, #f59e0b);
}

.group-badge.priority {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.group-badge.prohibitory {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.group-badge.mandatory {
    background: linear-gradient(135deg, #10b981, #059669);
}

.group-badge.special {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.group-badge.information {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.group-badge.service {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.group-badge.additional {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.group-heading h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.group-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border-left: 4px solid var(--accent-primary);
    font-style: italic;
}

.group-stats {
    display: inline-block;
    margin-left: 15px;
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Сетка знаков */
.signs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

/* Карточка знака */
.sign-card {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px;
    gap: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sign-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.sign-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.sign-card:hover::before {
    transform: scaleX(1);
}

/* Изображение знака */
.sign-image {
    flex: 0 0 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff !important;
    border-radius: 16px;
    padding: 10px;
    position: relative;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sign-card:hover .sign-image {
    border-color: var(--accent-primary);
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.sign-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background-color: transparent;
    filter: none !important;
}

.sign-number-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    border: 2px solid #ffffff;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

/* Информация о знаке */
.sign-info {
    flex: 1;
    min-width: 0;
}

.sign-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
    line-height: 1.4;
    padding-right: 5px;
}

.sign-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.sign-info .change-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 8px;
    background: var(--warning);
    color: white;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.sign-info .change-badge i {
    margin-right: 3px;
    font-size: 0.6rem;
}

/* Стили для пустых изображений (заглушка) */
.sign-image img[src*="placeholder"] {
    opacity: 0.5;
    filter: grayscale(100%);
}

/* ===== СТРАНИЦА ДОРОЖНОЙ РАЗМЕТКИ (MARKINGS.HTML) ===== */
.markings-page {
    padding: 40px 0 60px;

}


.markings-intro {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    background: var(--bg-secondary);
    padding: 20px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Навигация по разделам разметки */
.markings-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 60px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* Цветовые схемы для категорий разметки */
.horizontal-bg {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.horizontal-bg:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.vertical-bg {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.vertical-bg:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.colors-bg {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.colors-bg:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.fines-bg {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.fines-bg:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Группы разметки */
.markings-group {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
    background: var(--bg-card);
    border-radius: 32px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.markings-group:hover {
    box-shadow: var(--shadow-xl);
}

/* Сетка разметки */
.markings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

/* Карточка разметки */
.marking-card {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px;
    gap: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.marking-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.marking-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.marking-card:hover::before {
    transform: scaleX(1);
}

/* Изображение разметки */
.marking-image {
    flex: 0 0 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 10px;
    position: relative;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.marking-card:hover .marking-image {
    border-color: var(--accent-primary);
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.marking-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}

.marking-number-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    border: 2px solid var(--bg-card);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

/* Информация о разметке */
.marking-info {
    flex: 1;
    min-width: 0;
}

.marking-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
    line-height: 1.4;
    padding-right: 5px;
}

.marking-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.marking-rule {
    margin-top: 8px;
    padding: 4px 10px;
    background: var(--accent-soft);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-primary);
    display: inline-block;
    border: 1px solid var(--accent-light);
}

.marking-rule i {
    margin-right: 4px;
}

.marking-fines {
    margin-top: 12px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.05);
    border-radius: 12px;
    border-left: 4px solid #ef4444;
    font-size: 0.85rem;
}

.marking-info .change-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 8px;
    background: var(--warning);
    color: white;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.marking-info .change-badge i {
    margin-right: 3px;
    font-size: 0.6rem;
}

/* Сетка для цветов */
.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.color-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.color-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.color-sample {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    margin: 0 auto 15px;
    border: 2px solid var(--border-color);
}

.color-card.white .color-sample {
    background: #ffffff;
}

.color-card.yellow .color-sample {
    background: #fbbf24;
}

.color-card.orange .color-sample {
    background: #f97316;
}

.color-card.blue .color-sample {
    background: #3b82f6;
}

.color-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.color-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Таблица штрафов */
.fines-table {
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.fine-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.fine-row:last-child {
    border-bottom: none;
}

.fine-row:hover {
    background: var(--bg-card);
}

.fine-row.header {
    background: var(--accent-primary);
    color: white;
    font-weight: 700;
}

.fine-row.header .fine-cell {
    color: white;
}

.fine-cell {
    padding: 15px 20px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.fines-note {
    margin-top: 20px;
    padding: 15px 20px;
    background: var(--accent-soft);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--accent-light);
}

.fines-note i {
    color: var(--accent-primary);
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.fines-note p {
    margin: 0;
    line-height: 1.5;
}

/* ===== СТРАНИЦА СИГНАЛОВ РЕГУЛИРОВЩИКА (TRAFFIC-CONTROLLER.HTML) ===== */
.controller-page {
    padding: 40px 0 60px;
}

.controller-intro {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    background: var(--bg-secondary);
    padding: 20px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Навигация по сигналам */
.controller-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 60px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* Цветовые схемы для категорий регулировщика */
.position1-bg {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.position1-bg:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.position2-bg {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.position2-bg:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.position3-bg {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.position3-bg:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.rules-bg {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.rules-bg:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Группы сигналов */
.controller-group {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
    background: var(--bg-card);
    border-radius: 32px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.controller-group:hover {
    box-shadow: var(--shadow-xl);
}

/* Сетка для сигналов */
.controller-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}

/* Основная карточка сигнала */
.controller-card {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 25px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.controller-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.controller-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.controller-card:hover::before {
    transform: scaleX(1);
}

.main-card {
    grid-row: span 2;
}

/* Изображение регулировщика */
.controller-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    position: relative;
    min-height: 200px;
}

.controller-img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.controller-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-primary);
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Информация о сигнале */
.controller-info h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--accent-primary);
    border-left: 4px solid var(--accent-primary);
    padding-left: 15px;
}

.controller-meaning-block {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
}

.controller-meaning-block h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.controller-meaning-block h4 i {
    color: var(--accent-primary);
}

.controller-meaning-block ul {
    margin: 0 0 0 20px;
    color: var(--text-secondary);
}

.controller-meaning-block li {
    margin-bottom: 5px;
}

/* Блоки с разных сторон */
.left-right h4 i {
    color: #10b981;
}

.chest-back h4 i {
    color: #ef4444;
}

.left h4 i {
    color: #10b981;
}

.chest h4 i {
    color: #3b82f6;
}

.right-back h4 i {
    color: #ef4444;
}

.pedestrians h4 i {
    color: #f59e0b;
}

.all h4 i {
    color: #ef4444;
}

.exception h4 i {
    color: #f59e0b;
}

/* Блок заметок */
.controller-note {
    margin-top: 20px;
    padding: 15px;
    background: var(--accent-soft);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-primary);
    border: 1px dashed var(--accent-primary);
}

.controller-note.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: #f59e0b;
}

.controller-note i {
    font-size: 1.2rem;
}

/* Боковые карточки */
.side-card {
    background: var(--bg-card);
}

.side-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.side-badge {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.side-header h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.side-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    min-height: 120px;
}

.side-image img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.side-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 12px;
    font-weight: 600;
}

.side-rule.allowed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.side-rule.forbidden {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.side-rule i {
    font-size: 1.1rem;
}

/* Сетка правил */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.rule-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.rule-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.rule-icon i {
    font-size: 2rem;
    color: var(--accent-primary);
}

.rule-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.rule-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.rule-card ul {
    margin: 0 0 0 20px;
    color: var(--text-secondary);
}

.rule-card li {
    margin-bottom: 5px;
}

/* Мнемонические правила */
.mnemonic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mnemonic-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mnemonic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #f59e0b;
}

.mnemonic-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #f59e0b;
    border-left: 4px solid #f59e0b;
    padding-left: 12px;
}

.mnemonic-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* ===== СЧИТАЛОЧКИ РЕГУЛИРОВЩИКА ===== */
.folk-rule {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-card));
    border-radius: 20px;
    padding: 20px 25px;
    margin-bottom: 30px;
    border-left: 6px solid var(--accent-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.folk-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.folk-content {
    flex: 1;
}

.folk-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

.folk-text:last-child {
    margin-bottom: 0;
}

.folk-highlight {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.side-folk {
    margin-top: 15px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
}

.side-folk i {
    color: #f59e0b;
    font-size: 1rem;
}

.folk-blue {
    color: #3b82f6;
    font-weight: 600;
}

.folk-green {
    color: #10b981;
    font-weight: 600;
}

.folk-red {
    color: #ef4444;
    font-weight: 600;
}

.folk-orange {
    color: #f59e0b;
    font-weight: 600;
}

/* ===== ПОДСВЕТКА ЗНАКОВ ПРИ НАВЕДЕНИИ (INDEX.HTML) ===== */
.sign-inline {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 2px;
    padding: 3px 8px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    vertical-align: middle;
    white-space: nowrap;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sign-inline:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    background: var(--accent-soft);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.sign-inline:hover .sign-icon {
    transform: scale(1.1);
}

.sign-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    background: white;
    border-radius: 4px;
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.sign-number {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
    font-weight: 600;
    transition: color 0.2s ease;
}

.sign-inline:hover .sign-number {
    color: var(--accent-primary);
}

[data-theme="dark"] .sign-inline {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
}

[data-theme="dark"] .sign-inline:hover {
    background: var(--accent-light);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .sign-icon {
    background: white;
    border-color: var(--border-strong);
}

@keyframes gentlePulse {
    0% { box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1); }
    50% { box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3); }
    100% { box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1); }
}

.sign-inline:hover {
    animation: gentlePulse 1.5s infinite;
}

/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ УВЕЛИЧЕНИЯ ЗНАКА ===== */
.modal-overlay {

    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}


.modal-container {
    position: relative;
    max-width: 500px;
    width: 90vw;
    background-color: white;
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background-color: var(--accent-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
}

.modal-close:hover {
    background-color: var(--accent-hover);
    transform: scale(1.1) rotate(90deg);
}

.modal-close i {
    font-size: 20px;
}

.modal-image {
    max-width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.modal-info {
    text-align: center;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
}

.modal-info h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.modal-info .modal-number {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 1rem;
    font-family: monospace;
    margin-bottom: 10px;
}

.modal-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    max-height: 100px;
    overflow-y: auto;
    padding: 0 5px;
}

.modal-info p::-webkit-scrollbar {
    width: 4px;
}

.modal-info p::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-info p::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

[data-theme="dark"] .modal-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .modal-image {
    background-color: white;
}

[data-theme="dark"] .modal-info h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .modal-info p {
    color: var(--text-secondary);
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.signs-group .sign-card,
.markings-group .marking-card,
.controller-card,
.rule-card,
.mnemonic-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1200px) {
    .pdd-layout {
        grid-template-columns: 280px 1fr;
        gap: 20px;
    }
    
    .controller-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .controller-grid .main-card {
        grid-column: span 2;
    }
}

@media (max-width: 992px) {
    .signs-categories,
    .markings-categories,
    .controller-categories {
        border-radius: 30px;
        padding: 8px;
    }
    
    .category-link {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .group-heading h2 {
        font-size: 1.6rem;
    }
    
    .signs-grid,
    .markings-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
    
    .fine-row {
        grid-template-columns: 1.5fr 0.8fr 1fr;
    }
}

@media (max-width: 768px) {
    .pdd-layout {
        grid-template-columns: 1fr;
    }
    
    .sticky-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .chapter-heading {
        font-size: 1.5rem;
    }
    
    .theme-switcher {
        top: 10px;
        right: 10px;
    }
    
    .theme-btn {
        width: 40px;
        height: 40px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .signs-intro,
    .markings-intro,
    .controller-intro {
        font-size: 1rem;
        padding: 15px 20px;
        border-radius: 30px;
    }
    
    .signs-categories,
    .markings-categories,
    .controller-categories {
        gap: 8px;
        padding: 10px;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .category-link {
        padding: 8px 14px;
        font-size: 0.8rem;
        flex: 1 1 auto;
        text-align: center;
        border-radius: 30px;
    }
    
    .signs-group,
    .markings-group,
    .controller-group {
        padding: 20px 15px;
        border-radius: 24px;
    }
    
    .group-heading {
        flex-wrap: wrap;
    }
    
    .group-badge {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
    
    .group-heading h2 {
        font-size: 1.4rem;
    }
    
    .signs-grid,
    .markings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sign-card,
    .marking-card {
        padding: 15px;
    }
    
    .sign-image,
    .marking-image {
        flex: 0 0 80px;
        height: 80px;
    }
    
    .colors-grid {
        grid-template-columns: 1fr;
    }
    
    .fine-row {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 10px;
    }
    
    .fine-row.header {
        display: none;
    }
    
    .fine-cell {
        padding: 5px;
    }
    
    .fine-cell::before {
        content: attr(data-label);
        font-weight: 700;
        width: 100px;
        display: inline-block;
        color: var(--text-primary);
    }
    
    .controller-grid {
        grid-template-columns: 1fr;
    }
    
    .controller-grid .main-card {
        grid-column: span 1;
    }
    
    .controller-image {
        min-height: 150px;
    }
    
    .controller-info h3 {
        font-size: 1.2rem;
    }
    
    .rules-grid,
    .mnemonic-grid {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 20px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-container {
        padding: 20px;
        width: 95vw;
    }
    
    .modal-image {
        height: 200px;
        padding: 10px;
    }
    
    .modal-info h3 {
        font-size: 1.1rem;
    }
    
    .modal-info p {
        font-size: 0.9rem;
        max-height: 80px;
    }
    
    .modal-close {
        top: -10px;
        right: -10px;
        width: 35px;
        height: 35px;
    }
    
    .folk-rule {
        flex-direction: column;
        gap: 15px;
    }
    
    .folk-text {
        font-size: 1rem;
    }
    
    .folk-highlight {
        font-size: 1.1rem;
    }
    
    .mnemonic-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .mnemonic-content h4 {
        border-left: none;
        border-bottom: 3px solid #f59e0b;
        padding-left: 0;
        padding-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .item-heading {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chapter-heading {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .fine-amount {
        flex-wrap: wrap;
    }
    
    .modal-image {
        height: 150px;
    }
}

/* ===== ТЕМНАЯ ТЕМА ДЛЯ КАРТОЧЕК ===== */
[data-theme="dark"] .sign-image {
    background-color: #ffffff !important;
    border-color: var(--border-strong);
}

[data-theme="dark"] .sign-image img {
    filter: none !important;
}

[data-theme="dark"] .sign-number-badge,
[data-theme="dark"] .marking-number-badge {
    border-color: var(--bg-secondary);
}

[data-theme="dark"] .signs-group,
[data-theme="dark"] .markings-group,
[data-theme="dark"] .controller-group {
    background: var(--bg-secondary);
}

[data-theme="dark"] .group-description {
    background: var(--bg-card);
}

[data-theme="dark"] .marking-image {
    background: #2d3a4f;
    border-color: var(--border-strong);
}

[data-theme="dark"] .marking-image img {
    filter: brightness(0.95) drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
}

[data-theme="dark"] .color-card.white .color-sample {
    border-color: var(--border-strong);
}

[data-theme="dark"] .fines-table {
    background: var(--bg-card);
}

[data-theme="dark"] .controller-image {
    background: #2d3a4f;
    border-color: var(--border-strong);
}

[data-theme="dark"] .controller-img {
    filter: brightness(0.95) drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
}

[data-theme="dark"] .controller-meaning-block {
    background: var(--bg-card);
}

[data-theme="dark"] .side-card {
    background: var(--bg-secondary);
}

[data-theme="dark"] .rule-card {
    background: var(--bg-card);
}

[data-theme="dark"] .mnemonic-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
}

[data-theme="dark"] .controller-note {
    background: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .item-fines {
    background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .fine-article {
    color: #f87171;
}

[data-theme="dark"] .fines-note {
    background: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .marking-fines {
    background: rgba(239, 68, 68, 0.15);
}

/* ===== ФИКСИРОВАННОЕ БОКОВОЕ МЕНЮ ===== */
.sticky-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

.sticky-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sticky-sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.sticky-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}
/* ===== СЧЕТЧИК ОНЛАЙН ===== */
.online-counter {
    position: fixed;
    bottom: 100px;
    left: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid var(--accent-primary);
    border-radius: 50px;
    padding: 10px 20px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: all 0.3s ease;
    animation: slideInLeft 0.5s ease;
}

.online-counter:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.counter-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

.counter-content i {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

#online-count {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--accent-primary);
    min-width: 30px;
    text-align: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.counter-text {
    color: var(--text-secondary);
    font-weight: 500;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .online-counter {
        bottom: 80px;
        left: 20px;
        padding: 8px 15px;
    }
    
    .counter-content {
        font-size: 0.9rem;
    }
    
    #online-count {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .online-counter {
        bottom: 70px;
        left: 10px;
        padding: 6px 12px;
    }
}

/* Темная тема для счетчика */
[data-theme="dark"] .online-counter {
    background: rgba(30, 41, 59, 0.95);
    border-color: #3b82f6;
}

[data-theme="dark"] .counter-content i,
[data-theme="dark"] #online-count {
    color: #60a5fa;
}