/**
 * Темная тема для TelemetryX Monitoring
 * Можно переключать через JavaScript
 */

body.dark-theme {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #f8fafc;
}

.dark-theme .navbar {
    background: rgba(26, 32, 46, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme .sidebar {
    background: rgba(26, 32, 46, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.dark-theme .sidebar-item {
    color: #cbd5e0;
}

.dark-theme .sidebar-item:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #ffffff;
}

.dark-theme .sidebar-item.active {
    color: #ffffff;
}

.dark-theme .sidebar-item i {
    color: #cbd5e0;
}

.dark-theme .sidebar-item:hover i,
.dark-theme .sidebar-item.active i {
    color: #ffffff;
}

.dark-theme .card {
    background: rgba(45, 55, 72, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.dark-theme .card::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark-theme .card-header {
    background: rgba(45, 55, 72, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-weight: 600;
}

.dark-theme .card-title {
    color: #f8fafc !important;
}

.dark-theme .card-body {
    color: #f8fafc;
}

/* Таблицы в темной теме */
.dark-theme .table {
    background: rgba(45, 55, 72, 0.9);
    color: #f8fafc;
}

.dark-theme .table thead th {
    background: rgba(26, 32, 46, 0.9);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-weight: 600;
}

.dark-theme .table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

.dark-theme .table td,
.dark-theme .table th {
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

/* Формы в темной теме */
.dark-theme .form-control {
    background: rgba(45, 55, 72, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

.dark-theme .form-control::placeholder {
    color: #a0aec0;
}

.dark-theme .form-control:focus {
    background: rgba(45, 55, 72, 1);
    border-color: var(--primary-color);
    color: #f8fafc;
}

.dark-theme .form-select {
    background: rgba(45, 55, 72, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

.dark-theme .form-label {
    color: #f8fafc;
    font-weight: 500;
}

/* Модальные окна */
.dark-theme .modal-content {
    background: rgba(45, 55, 72, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.dark-theme .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme .modal-title {
    color: #f8fafc;
}

/* Авторизация */
.dark-theme .login-form {
    background: rgba(45, 55, 72, 0.95);
    color: #f8fafc;
}

.dark-theme .login-form .form-title {
    color: #f8fafc;
}

/* Индикаторы уровня */
.dark-theme .level-indicator {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .level-fill {
    background: linear-gradient(90deg, #e74c3c 0%, #f39c12 30%, #2ecc71 100%);
}

.dark-theme .level-mini-indicator {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .dashboard-header {
    background: rgba(45, 55, 72, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

/* Заголовки */
.dark-theme h1,
.dark-theme h2,
.dark-theme h3,
.dark-theme h4,
.dark-theme h5,
.dark-theme h6 {
    color: #f8fafc;
}

/* Текст */
.dark-theme p,
.dark-theme span,
.dark-theme div,
.dark-theme td,
.dark-theme th {
    color: #f8fafc;
}

/* Ссылки */
.dark-theme a {
    color: #7c3aed;
}

.dark-theme a:hover {
    color: #8b5cf6;
}

/* Статистические карточки */
.dark-theme .dashboard-stat-card h4 {
    color: #f8fafc;
}

.dark-theme .dashboard-stat-card .card-title {
    color: #cbd5e0;
}

/* Карточки цилиндров */
.dark-theme .cylinder-card {
    background: rgba(45, 55, 72, 0.9);
    color: #f8fafc;
}

.dark-theme .cylinder-card .card-title {
    color: #f8fafc;
}

.dark-theme .cylinder-card .fw-bold {
    color: #f8fafc;
}

/* Информация о пользователе */
.dark-theme .user-info {
    color: #f8fafc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Контейнер для переключателя темы */
.theme-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-theme .theme-toggle-container {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Переключатель темы - маленький кружок по центру */
.theme-toggle-sidebar {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle-sidebar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle-sidebar i {
    font-size: 0.9rem;
    color: var(--gray-600);
    transition: all 0.3s ease;
}

/* Стили для темной темы */
.dark-theme .theme-toggle-sidebar {
    background: rgba(45, 55, 72, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark-theme .theme-toggle-sidebar i {
    color: #fbbf24;
}

/* Иконки для разных тем */
.dark-theme .theme-toggle-sidebar i::before {
    content: "\f185"; /* fa-sun */
}

.theme-toggle-sidebar i::before {
    content: "\f186"; /* fa-moon */
}

/* Полностью убираем старый переключатель */
.theme-switcher {
    display: none !important;
}

/* Убираем старые стили */
.theme-toggle-item {
    display: none !important;
}

/* Алерты */
.dark-theme .alert {
    background: rgba(45, 55, 72, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.dark-theme .alert-warning {
    background: rgba(234, 179, 8, 0.2);
    border-color: rgba(234, 179, 8, 0.3);
    color: #fbbf24;
}

.dark-theme .alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Кнопки */
.dark-theme .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.3);
    color: #f8fafc;
}

.dark-theme .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #f8fafc;
}

/* Отладочная панель */
.dark-theme #cylinders-debug-panel {
    background: rgba(26, 32, 46, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
}

.dark-theme #cylinders-debug-panel button {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Особые элементы */
.dark-theme .text-muted {
    color: #a0aec0 !important;
}

.dark-theme .border-bottom {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Проценты и метрики */
.dark-theme .fw-bold {
    color: #f8fafc;
}
