/* ========== RESET & БАЗОВЫЕ СТИЛИ (светлая тема) ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Новая светлая палитра (вдохновлено парсером) */
    --bg-body: #eef2f5;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #0b3b5f;
    --text-secondary: #2c5a74;
    --accent: #2c7da0;
    --accent-hover: #1f5e7a;
    --border-light: #cbd5e1;
    --border-card: #e2edf2;
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    --sidebar-width: 280px;
    --transition: all 0.25s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ========== LAYOUT (DESKTOP) ========== */
.layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ========== SIDEBAR (МЕНЮ) ========== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(0,0,0,0.02);
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-card);
}

.logo {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
}

.nav-menu {
    list-style: none;
    padding: 1.5rem 0;
    flex-grow: 1;
}

.nav-menu li {
    margin: 0.5rem 0;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--accent);
    background-color: rgba(44, 125, 160, 0.08);
    border-left-color: var(--accent);
}

.nav-link.active {
    color: var(--accent);
    background-color: rgba(44, 125, 160, 0.12);
    border-left-color: var(--accent);
}

.sidebar-footer {
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-card);
    text-align: center;
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
.content {
    flex: 1;
    padding: 2.5rem 3rem;
    max-width: calc(100% - var(--sidebar-width));
}

/* ========== ГАМБУРГЕР (МОБИЛЬНЫЕ) ========== */
.menu-toggle {
    display: none;
}

.hamburger {
    display: none;
    cursor: pointer;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--bg-sidebar);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    flex-direction: column;
    gap: 5px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* ========== АНИМАЦИЯ ПОЯВЛЕНИЯ ========== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== КАРТОЧКИ И СЕКЦИИ ========== */
section {
    margin-bottom: 2.5rem;
}

.card {
    background-color: var(--bg-card);
    border-radius: 28px;
    padding: 1.75rem;
    border: 1px solid var(--border-card);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

p, ul, .info-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

ul {
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

/* ========== КНОПКИ (единый стиль) ========== */
.btn {
    display: inline-block;
    background-color: var(--accent);
    border: none;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover {
    background: rgba(44,125,160,0.1);
}

.quick-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ========== СПЕЦИФИЧНЫЕ СТИЛИ ДЛЯ ИНСТРУМЕНТОВ (парсер, конвертер, генератор) ========== */
.tool-container .converter-group,
.tool-container .password-options {
    margin-bottom: 1.5rem;
}

.tool-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.tool-container input[type="number"],
.tool-container input[type="text"],
#generated-password {
    width: 100%;
    padding: 0.75rem;
    background-color: #fefefe;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.tool-container input:focus {
    outline: none;
    border-color: var(--accent);
}

.password-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.option label {
    margin-bottom: 0;
}

input[type="range"] {
    flex: 1;
    min-width: 150px;
}

.password-result {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.password-result input {
    flex: 2;
    font-family: monospace;
}

/* ========== СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ ПАРСЕРА (таблицы, компактные элементы) ========== */
.table-wrapper {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid var(--border-card);
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    min-width: 1150px;
}

th {
    background: #f1f9fe;
    color: var(--text-primary);
    padding: 12px 6px;
    font-weight: 600;
    border-bottom: 2px solid #cfdfe8;
    text-align: center;
    white-space: nowrap;
}

td {
    padding: 10px 6px;
    border-bottom: 1px solid var(--border-card);
    vertical-align: top;
}

tr:hover td {
    background-color: #fafeff;
}

.mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
}

.compact-badge {
    background: #eef2ff;
    border-radius: 30px;
    padding: 4px 8px;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}

.col-vehicle { min-width: 100px; }
.col-counter { min-width: 55px; text-align: center; }
.col-validity { min-width: 110px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
    align-items: center;
}

textarea {
    width: 100%;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: #fefefe;
    resize: vertical;
}

.error-msg {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px 16px;
    border-radius: 18px;
    margin: 16px 0;
    font-size: 0.8rem;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 280px;
        height: 100vh;
        z-index: 150;
        background-color: var(--bg-sidebar);
        box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    }
    
    .menu-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }
    
    .content {
        max-width: 100%;
        padding: 5rem 1.5rem 2rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .quick-links {
        flex-direction: column;
    }
    
    .btn {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 5rem 1rem 1.5rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}