/* =========================================
   СВЕТЛАЯ ТЕМА
   ========================================= */
:root {
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --primary: #22c55e;
    --primary-hover: #16a34a;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --error: #ef4444;
}

/* =========================================
   ТЕМНАЯ ТЕМА (По макету)
   ========================================= */
:root[data-theme="dark"] {
    --bg-main: #0b111a;
    --card-bg: #131b26;
    --border: #212d3d;
    --primary: #22c55e;
    --primary-hover: #16a34a;  
    --text-main: #f8fafc;
    --text-muted: #94a3b8;     
    --error: #ef4444;          
}

/* БАЗА */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease; 
}

/* ЛЕЙАУТ */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 280px; background-color: var(--card-bg); border-right: 1px solid var(--border); padding: 30px 20px; display: flex; flex-direction: column; position: fixed; height: 100vh; box-sizing: border-box; z-index: 10; }
.main-content { margin-left: 280px; flex-grow: 1; padding: 40px; max-width: 1400px; }

/* КНОПКИ И ИНПУТЫ */
button { font-family: 'Inter', sans-serif; cursor: pointer; border-radius: 8px; font-weight: 600; padding: 12px 24px; transition: all 0.2s ease; border: none; }
.btn-primary { background-color: var(--primary); color: #ffffff; }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); }
.btn-secondary { background-color: transparent; color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); background-color: rgba(34, 197, 94, 0.05); color: var(--primary); }

.auth-input {
    width: 100%; padding: 14px 20px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg-main); color: var(--text-main); font-family: inherit; font-size: 1rem;
    box-sizing: border-box; transition: all 0.3s ease;
}
.auth-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15); outline: none; }

/* ИСПРАВЛЕНИЕ ДВОЙНОЙ СТРЕЛКИ В ВЫПАДАЮЩЕМ СПИСКЕ */
select.auth-input {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* ПРОГРЕСС БАРЫ И МЕНЮ */
.progress-bar-thin { height: 8px; background: var(--bg-main); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill-thin { height: 100%; border-radius: 10px; transition: width 1s ease-in-out; }
.badge { font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; font-weight: 600; text-transform: uppercase; }
.badge-silver { background: #1e293b; color: #cbd5e1; border: 1px solid #475569; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: var(--text-main); text-decoration: none; border-radius: 8px; margin-bottom: 5px; font-weight: 500; transition: all 0.2s; }
.nav-item i { width: 18px; height: 18px; color: var(--text-muted); }
.nav-item:hover { background-color: rgba(34, 197, 94, 0.1); color: var(--primary); }
.nav-item:hover i { color: var(--primary); }
.nav-item.active { background-color: var(--primary); color: white; }
.nav-item.active i { color: white; }
.btn-theme-toggle { margin-top: auto; width: 100%; padding: 10px; background: transparent; border: 1px dashed var(--border); color: var(--text-muted); }
/* =========================================
   СТИЛИ КАРТОЧЕК И ПОДСВЕТКИ ОШИБОК
   ========================================= */
:root {
    --card-fail: rgba(239, 68, 68, 0.05); /* Легкий красный фон для ошибок */
}

.criterion-card {
    padding: 20px;
    border-radius: 12px;
    color: var(--text-main);
    transition: transform 0.2s;
    border: 1px solid var(--border);
}
.criterion-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 10px; font-size: 1.1rem; }
.criterion-comment { margin-bottom: 10px; color: var(--text-main); }
.criterion-quote { background: rgba(239, 68, 68, 0.1); padding: 10px; border-left: 3px solid var(--error); margin-bottom: 10px; border-radius: 4px; font-size: 0.9rem; }
.criterion-correction { background: rgba(34, 197, 94, 0.1); padding: 10px; border-left: 3px solid var(--success); border-radius: 4px; font-size: 0.9rem; }

/* Подсветка текста в матрешке */
.highlight-error {
    background-color: rgba(239, 68, 68, 0.2);
    border-bottom: 2px dashed var(--error);
    cursor: pointer;
    padding: 0 2px;
    border-radius: 3px;
    transition: background-color 0.2s;
}
.highlight-error:hover { background-color: rgba(239, 68, 68, 0.4); }
.active-error { background-color: var(--error); color: white; border-bottom: none; }
.active-focus { box-shadow: 0 0 0 2px var(--error); }
.blink-animation { animation: blink 1s ease-in-out; }
@keyframes blink { 0% { opacity: 0.5; } 100% { opacity: 1; } }
/* Дизайн списка рекомендаций */
#recommendationsList li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
}
#recommendationsList li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #3b82f6; /* Синий цвет галочки */
    font-weight: bold;
    font-size: 1.2rem;
}
.stats-tabs {
    display: flex;
    justify-content: flex-start;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background-color: transparent;
    color: #4b5563;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background-color: #f3f4f6;
}

.tab-btn.active {
    background-color: #6366f1; /* Твой фирменный цвет (можно поменять) */
    color: white;
    border-color: #6366f1;
}
.criterion-active {
    border: 2px solid #ef4444 !important;
    border-radius: 6px !important;
    background: rgba(239, 68, 68, 0.15) !important;
    padding: 0 2px;
    text-decoration: none !important;
}
.active-error {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: 2px solid #ef4444 !important;
    border-radius: 6px !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6) !important;
    padding: 0 2px;
    text-decoration: none !important;
}