/* ПДД РФ — Общие стили */

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

body {
    font-family: 'Trebuchet MS', Tahoma, Verdana, sans-serif;
    background: linear-gradient(150deg, #2c4f7a 0%, #152640 100%);
    min-height: 100vh;
    padding: 20px;
}

/* =============== ТАБЛИЦА-ОСНОВА =============== */
table.main-table {
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    border-collapse: collapse;
    width: 1480px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    margin: 0 auto;
}

table.main-table td {
    padding: 20px;
}

/* =============== ШАПКА / НАВИГАЦИЯ =============== */
.header {
    background: linear-gradient(135deg, #27496d 0%, #142850 100%);
    color: white;
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-menu a {
    color: white !important;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    transition: all 0.25s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #ffd700;
    color: #27496d !important;
    border-color: #ffd700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* =============== САЙДБАРЫ =============== */
.sidebar {
    background: linear-gradient(160deg, #aac6e8 0%, #6c9bd2 100%);
    border-radius: 10px;
    vertical-align: top;
    width: 15%;
}

.sidebar-title {
    color: #1a3a5c;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 9px;
    border-bottom: 2px solid rgba(39,73,109,0.5);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin: 7px 0;
    padding: 9px 12px;
    background: rgba(255,255,255,0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 13px;
    color: #1a3a5c;
    line-height: 1.3;
}

.sidebar-menu li:hover {
    background: rgba(255,255,255,0.5);
    border-left-color: #27496d;
    transform: translateX(4px);
}

.sidebar-menu li a {
    color: inherit;
    text-decoration: none;
    display: block;
}

/* =============== ВИДЖЕТЫ =============== */
.widget {
    background: rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 13px;
    margin: 14px 0;
    border: 1px solid rgba(255,255,255,0.55);
}

.widget h4 {
    color: #1a3a5c;
    margin-bottom: 9px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(39,73,109,0.25);
}

.widget p {
    font-size: 13px;
    color: #1a3a5c;
    margin: 5px 0;
    line-height: 1.5;
}

.poll-btn {
    display: inline-block;
    padding: 7px 14px;
    margin: 4px 2px;
    background: #27496d;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.poll-btn:hover {
    background: #ffd700;
    color: #27496d;
}

.poll-bar-wrap {
    margin: 5px 0 3px;
}

.poll-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #1a3a5c;
    margin-bottom: 3px;
}

.poll-bar {
    height: 7px;
    background: rgba(255,255,255,0.4);
    border-radius: 4px;
    overflow: hidden;
}

.poll-bar-fill {
    height: 100%;
    background: #27496d;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.fine-input {
    width: 100%;
    padding: 8px 13px;
    border: 2px solid rgba(39,73,109,0.5);
    border-radius: 18px;
    margin: 6px 0;
    outline: none;
    font-size: 12px;
    font-family: inherit;
    background: rgba(255,255,255,0.8);
    color: #1a3a5c;
    transition: border-color 0.2s ease;
}

.fine-input:focus {
    border-color: #27496d;
    background: white;
}

.check-btn {
    width: 100%;
    padding: 9px;
    background: #27496d;
    color: white;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.check-btn:hover {
    background: #ffd700;
    color: #27496d;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

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

.useful-links li {
    margin: 5px 0;
}

.useful-links li a {
    font-size: 12px;
    color: #1a3a5c;
    text-decoration: none;
    display: block;
    padding: 5px 8px;
    border-radius: 5px;
    transition: background 0.2s;
    line-height: 1.4;
}

.useful-links li a:hover {
    background: rgba(255,255,255,0.4);
    color: #142850;
}

/* =============== ОСНОВНОЙ КОНТЕНТ =============== */
.content {
    background: #f0f4f8;
    vertical-align: top;
    width: 70%;
}

.content-title {
    color: #142850;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 14px;
    border-bottom: 3px solid #27496d;
}

.content-block {
    background: white;
    border-radius: 8px;
    padding: 18px 20px;
    margin: 14px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
    border-left: 4px solid #27496d;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.content-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.11);
}

.content-block h3 {
    color: #27496d;
    margin-bottom: 10px;
    font-size: 17px;
}

.content-block p {
    color: #444;
    line-height: 1.75;
    font-size: 14px;
}

.content-link {
    display: inline-block;
    padding: 9px 22px;
    background: linear-gradient(135deg, #27496d, #142850);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin-top: 13px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.content-link:hover {
    background: #ffd700;
    color: #27496d;
    transform: scale(1.04);
}

/* Таблицы правил */
.rules-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13px;
}

.rules-table th {
    background: #27496d;
    color: white;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
}

.rules-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #e0e8f0;
    color: #333;
    vertical-align: top;
    border-left: none;
    border-right: none;
    border-top: none;
    background: none;
    box-shadow: none;
    transform: none;
}

.rules-table tr:nth-child(even) td {
    background: #f5f8fc;
}

.rules-table tr:hover td {
    background: #e8f0fe;
}

/* Выделение важных правил */
.rule-note {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13px;
    color: #5d4037;
    line-height: 1.6;
}

.rule-note strong {
    color: #c75000;
}

.rule-warning {
    background: #fbe9e7;
    border-left: 4px solid #e53935;
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13px;
    color: #5d1a1a;
    line-height: 1.6;
}

/* =============== ДОРОЖНЫЕ ЗНАКИ =============== */
.signs-category {
    margin: 20px 0 12px;
    padding: 12px 18px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 15px;
    color: white;
    letter-spacing: 0.5px;
}

.cat-warning  { background: linear-gradient(135deg, #c62828, #e53935); }
.cat-priority { background: linear-gradient(135deg, #bf360c, #e64a19); }
.cat-prohibit { background: linear-gradient(135deg, #880e4f, #c62828); }
.cat-mandatory{ background: linear-gradient(135deg, #0d47a1, #1565c0); }
.cat-info     { background: linear-gradient(135deg, #004d40, #00695c); }
.cat-service  { background: linear-gradient(135deg, #1a237e, #283593); }

.signs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.sign-card {
    background: white;
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sign-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.13);
}

/* CSS фигуры знаков */
.sv {
    margin-bottom: 10px;
    flex-shrink: 0;
}

/* Предупреждающий — треугольник */
.sv-warning {
    width: 0; height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 52px solid #e53935;
    position: relative;
}
.sv-warning::after {
    content: '';
    position: absolute;
    top: 8px; left: -22px;
    width: 0; height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-bottom: 38px solid #fffde7;
}

/* Запрещающий — круг с красной каймой */
.sv-prohibit {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: white;
    border: 5px solid #e53935;
    position: relative;
}

/* С полосой (въезд запрещён) */
.sv-prohibit-bar::after {
    content: '';
    position: absolute;
    top: 50%; left: -5px;
    transform: translateY(-50%);
    width: calc(100% + 10px);
    height: 5px;
    background: #e53935;
    border-radius: 3px;
}

/* Диагональ (перечёркивание) */
.sv-prohibit-cross::after {
    content: '';
    position: absolute;
    top: 5px; left: calc(50% - 2.5px);
    width: 5px;
    height: calc(100% - 10px);
    background: #e53935;
    border-radius: 3px;
    transform: rotate(45deg);
    transform-origin: center;
}

/* Предписывающий — синий круг */
.sv-mandatory {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #1565c0;
}

/* Информационный — синий прямоугольник */
.sv-info {
    width: 58px; height: 40px;
    background: #1565c0;
    border-radius: 4px;
}

/* Знак приоритета — жёлтый ромб */
.sv-priority {
    width: 38px; height: 38px;
    background: #ffd700;
    border: 3px solid white;
    transform: rotate(45deg);
    box-shadow: 0 0 0 2px #aaa;
    margin: 6px auto;
}

/* Уступите дорогу — перевёрнутый треугольник */
.sv-yield {
    width: 0; height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-top: 52px solid #e53935;
    position: relative;
}
.sv-yield::after {
    content: '';
    position: absolute;
    top: -48px; left: -22px;
    width: 0; height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 38px solid white;
}

/* Сервисный — синий прямоугольник с белой рамкой */
.sv-service {
    width: 58px; height: 40px;
    background: #283593;
    border: 3px solid white;
    border-radius: 4px;
    box-shadow: 0 0 0 2px #283593;
}

.sign-number {
    font-size: 10px;
    color: #999;
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.sign-name {
    font-size: 12px;
    font-weight: 700;
    color: #27496d;
    margin-bottom: 4px;
    line-height: 1.3;
}

.sign-desc {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

/* =============== ФУТЕР =============== */
.footer {
    background: linear-gradient(135deg, #27496d 0%, #142850 100%);
    color: white;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-section {
    text-align: left;
    min-width: 180px;
}

.footer-section h4 {
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin: 6px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.footer-section li:hover {
    background: rgba(255,215,0,0.15);
    color: #ffd700;
    transform: translateX(3px);
}

.footer-section li a {
    color: inherit;
    text-decoration: none;
}

.copyright {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,215,0,0.3);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

/* =============== FAQ (страница помощи) =============== */
.faq-item {
    background: white;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
}

.faq-question {
    padding: 14px 18px;
    background: white;
    color: #27496d;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border-left: 4px solid #27496d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s;
}

.faq-question:hover {
    background: #f0f4f8;
}

.faq-question::after {
    content: '+';
    font-size: 20px;
    color: #27496d;
    line-height: 1;
    transition: transform 0.3s;
}

.faq-question.open::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.2s ease;
    font-size: 13px;
    color: #444;
    line-height: 1.7;
}

.faq-answer.open {
    padding: 12px 18px 16px;
    max-height: 300px;
}

/* =============== КОНТАКТЫ =============== */
.contact-card {
    background: white;
    border-radius: 8px;
    padding: 18px;
    margin: 12px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-left: 4px solid #27496d;
}

.contact-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #27496d, #142850);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-info h4 {
    color: #27496d;
    font-size: 14px;
    margin-bottom: 4px;
}

.contact-info p {
    color: #555;
    font-size: 13px;
    line-height: 1.6;
}

/* =============== АНИМАЦИИ =============== */
@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.badge {
    display: inline-block;
    background: #ffd700;
    color: #27496d;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
    font-weight: 700;
    animation: pulse 2s infinite;
}
