/* ============================================================================
   СТИЛИ ДЛЯ СИСТЕМЫ МОНИТОРИНГА ПОСЕЩАЕМОСТИ ЭЛЕКТРОННЫХ ЗАЛОВ
   Адаптировано из get_library_netstats.css
============================================================================ */

:root {
    --primary: #3498db;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #17a2b8;
    --dark: #343a40;
    --light: #f8f9fa;
    --critical: #e74c3c;
    --critical-light: #fdf0ed;
    --warning-light: #fef5e7;
    --normal-light: #eafaf1;
    --excellent-light: #ebf5fb;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 0;
}

.container-main {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* Панель управления */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.btn-group { display: flex; gap: 10px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #2980b9; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(52,152,219,0.3); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #27ae60; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(46,204,113,0.3); }

.btn-secondary { background: #6c757d; color: white; }

.lang-btn {
    background: #e9ecef;
    color: #495057;
    padding: 8px 16px;
}
.lang-btn.active { background: var(--primary); color: white; }
.lang-btn:hover:not(.active) { background: #dee2e6; }

/* Карточки */
.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    min-height: 200px;
}
.kpi-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }

/* Лоадер для отдельных блоков */
.kpi-loader {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center; justify-content: center;
    border-radius: 12px;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.kpi-loader .spinner-border { width: 3rem; height: 3rem; color: var(--primary); }

/* Значения KPI */
.kpi-value { font-size: 2.5rem; font-weight: 700; margin: 10px 0; line-height: 1.2; }
.kpi-value small { font-size: 1rem; font-weight: normal; color: #6c757d; }
.kpi-label { font-size: 0.9rem; color: #6c757d; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }

/* Бейджи статусов */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-critical { background: rgba(231,76,60,0.15); color: #c0392b; border: 1px solid rgba(231,76,60,0.3); }
.status-warning { background: rgba(243,156,18,0.15); color: #d35400; border: 1px solid rgba(243,156,18,0.3); }
.status-normal { background: rgba(46,204,113,0.15); color: #27ae60; border: 1px solid rgba(46,204,113,0.3); }
.status-excellent { background: rgba(52,152,219,0.15); color: #2980b9; border: 1px solid rgba(52,152,219,0.3); }

/* Цветовые классы для текста */
.color-critical, .critical { color: #e74c3c !important; }
.color-warning, .warning { color: #f39c12 !important; }
.color-normal, .normal { color: #2ecc71 !important; }
.color-excellent, .excellent { color: #3498db !important; }

/* Фоновые классы */
.bg-critical { background-color: var(--critical-light); }
.bg-warning { background-color: var(--warning-light); }
.bg-normal { background-color: var(--normal-light); }
.bg-excellent { background-color: var(--excellent-light); }

/* Таблицы */
.table-responsive { overflow-x: auto; margin: 15px 0; border-radius: 8px; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.data-table th {
    background: #f8f9fa;
    padding: 14px 12px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    position: sticky; top: 0; z-index: 5;
    text-align: left;
}
.data-table td { padding: 12px; border-bottom: 1px solid #e9ecef; }
.data-table tr:hover { background: #f8f9fa; }

/* Контейнеры для графиков */
.chart-container { position: relative; height: 300px; margin: 20px 0; }

/* Заголовки секций */
.section-title {
    color: #495057;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
}
.section-title i { font-size: 1.5rem; color: var(--primary); }

/* Состояние "нет данных" */
.no-data {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    color: #6c757d;
}
.no-data i { font-size: 4rem; opacity: 0.3; margin-bottom: 20px; }
.no-data h4 { font-size: 1.5rem; margin-bottom: 10px; font-weight: 300; }

/* Вкладки */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.nav-tabs .nav-link {
    color: #495057;
    font-weight: 500;
    padding: 12px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
}
.nav-tabs .nav-link:hover { border-bottom-color: #dee2e6; color: var(--primary); }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Статистические карточки */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s;
    border: 1px solid #e9ecef;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.stat-value { font-size: 2.5rem; font-weight: bold; color: var(--primary); line-height: 1.2; }
.stat-label { font-size: 0.9rem; color: #6c757d; margin-top: 5px; text-transform: uppercase; letter-spacing: 1px; }

/* Хлебные крошки */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 20px;
    list-style: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.breadcrumb-item + .breadcrumb-item { padding-left: 8px; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; padding-right: 8px; color: #6c757d; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: #6c757d; }

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    overflow-y: auto;
}
.modal.show { display: block; }
.modal-dialog { max-width: 90%; margin: 30px auto; position: relative; }
.modal-dialog.modal-xl { max-width: 90%; }
.modal-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.modal-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dee2e6;
}
.modal-header.bg-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.modal-header.bg-info { background: linear-gradient(135deg, #17a2b8 0%, #138496 100%); color: white; }
.modal-header.bg-success { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); color: white; }
.modal-title { font-size: 1.25rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: 16px 20px; border-top: 1px solid #dee2e6; display: flex; justify-content: flex-end; gap: 10px; }
.btn-close { background: transparent; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; opacity: 0.7; color: white; }
.btn-close-white { color: white; }
.btn-close:hover { opacity: 1; }

/* Спиннеры */
.spinner-border {
    display: inline-block;
    width: 2rem; height: 2rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}
@keyframes spinner-border { to { transform: rotate(360deg); } }

/* Анимации */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.tab-pane.active .kpi-card { animation: fadeIn 0.3s ease-out; }

/* Сетка */
.row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12, .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8, .col-lg-12 { padding: 0 12px; flex: 0 0 auto; }
.col-md-6 { width: 50%; } .col-md-4 { width: 33.333%; } .col-md-3 { width: 25%; } .col-md-8 { width: 66.667%; } .col-md-12 { width: 100%; }
@media (max-width: 768px) { .col-md-6, .col-md-4, .col-md-3, .col-md-8 { width: 100%; } }

/* Отступы */
.mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; } .mt-2 { margin-top: 0.5rem; } .py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; } .py-5 { padding-top: 3rem; padding-bottom: 3rem; }

/* Иконки Bootstrap Icons */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");

/* Адаптивность */
@media (max-width: 768px) {
    .container-main { padding: 10px; }
    .kpi-value { font-size: 2rem; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 6px; }
    .stat-value { font-size: 2rem; }
    .control-panel { flex-direction: column; gap: 10px; }
    .btn-group { width: 100%; justify-content: center; }
    .modal-dialog.modal-lg, .modal-dialog.modal-xl { max-width: 95%; margin: 10px auto; }
}

/* Дополнительные утилиты */
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.fw-bold { font-weight: 600; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-10 { gap: 10px; }

/* Стили для карточек залов */
.sigla-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    border-left: 4px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}
.sigla-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }

/* Прогресс бары */
.progress-bar-container {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}
.progress-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-bar.critical { background: var(--critical); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.normal { background: var(--normal); }
.progress-bar.excellent { background: var(--excellent); }