/* static/css/main.css */
/* themes.css */
:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #ff9e6d;
    --info: #4895ef;
    --light: #f8f9fa;
    --dark: #212529;
}

/* layout.css */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
}

.navbar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar {
    background: white;
    height: calc(100vh - 56px);
    box-shadow: 3px 0 10px rgba(0,0,0,0.05);
    position: fixed;
    left: 0;
    top: 56px;
    width: 250px;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: #495057;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: #e9ecef;
    color: var(--primary);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: 250px;
    padding: 20px;
    margin-top: 56px;
}

/* components.css */
.card {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.card-header {
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.analysis-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.analysis-item:hover {
    background-color: #e9ecef;
}

.sql-preview {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.quick-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-size: 1.1rem;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

/* --- ИСПРАВЛЕНО: Стили для StepByStepExplainer --- */
.step-card {
    /* Убран border-left: 4px solid #0d6efd; из .step-card */
    /* border-left: 4px solid #0d6efd; <- УБРАНО */
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.step-card:hover {
    transform: translateX(5px); /* Сдвиг при наведении */
}

.step-header {
    cursor: pointer;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.step-content {
    padding: 1.25rem;
}

.step-metrics {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.step-detail {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.step-detail i {
    color: #6c757d;
    margin-right: 0.25rem;
}

.progress {
    height: 25px;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px dashed #e9ecef;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    font-weight: 500;
    color: #495057;
}

.metric-value {
    font-family: monospace;
    color: #0d6efd;
}

.operation-badge {
    font-size: 0.85em;
    padding: 0.35em 0.65em;
    margin-right: 0.25rem;
}

.cost-high {
    background-color: #f8d7da;
    color: #721c24;
}

.cost-medium {
    background-color: #fff3cd;
    color: #856404;
}

.cost-low {
    background-color: #d1e7dd;
    color: #0f5132;
}

.connection-line {
    position: relative;
    padding-left: 20px;
}

.connection-line::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background-color: #0d6efd;
}

.accordion-icon {
    transition: transform 0.2s ease-in-out;
}
[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}
[aria-expanded="false"] .accordion-icon {
    transform: rotate(0deg);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }
    .main-content {
        margin-left: 0;
        margin-top: 56px;
    }
    .quick-stats {
        flex-direction: column;
        gap: 1rem;
    }
    .stat-number {
        font-size: 2rem;
    }
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.bg-orange {
    background-color: #fd7e14 !important;
    color: white !important;
}
.problem-card.orange {
    border-left-color: #fd7e14;
}