/* admin/modules/core/templates/admin.css - Базовые стили шаблона */

/* === CSS Variables === */
/* Темная тема (по умолчанию) */
:root {
    /* === БАЗОВЫЙ РАЗМЕР ШРИФТА === */
    --base-font-size: 16px; /* Изменяйте это значение для масштабирования всех шрифтов */

    /* === СИСТЕМА РАЗМЕРОВ ШРИФТОВ === */
    --font-size-xxs: 0.625rem;   /* 10px при базе 16px */
    --font-size-xs-plus: 0.6875rem; /* 11px при базе 16px */
    --font-size-xs: 0.75rem;     /* 12px при базе 16px */
    --font-size-sm: 0.875rem;    /* 14px при базе 16px */
    --font-size-base: 1rem;      /* 16px при базе 16px */
    --font-size-md: 1.125rem;    /* 18px при базе 16px */
    --font-size-lg: 1.25rem;     /* 20px при базе 16px */
    --font-size-xl: 1.5rem;      /* 24px при базе 16px */
    --font-size-2xl: 1.875rem;   /* 30px при базе 16px */
    --font-size-3xl: 2.25rem;    /* 36px при базе 16px */
    --font-size-4xl: 3rem;       /* 48px при базе 16px */
    
    /* === РАЗМЕРЫ ДЛЯ СПЕЦИАЛЬНЫХ ЭЛЕМЕНТОВ === */
    --font-size-heading-1: var(--font-size-2xl);
    --font-size-heading-2: var(--font-size-xl);
    --font-size-heading-3: var(--font-size-lg);
    --font-size-body: var(--font-size-base);
    --font-size-small: var(--font-size-sm);
    --font-size-tiny: var(--font-size-xs);
    
    /* === ОСТАЛЬНЫЕ ПЕРЕМЕННЫЕ === */
    --primary-gradient: linear-gradient(45deg, #00d4ff, #ff3366);
    --bg-gradient: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --select: #26263f;
    --close-bg: rgb(55 55 79);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --accent-blue: #00d4ff;
    --accent-pink: #ff3366;
    --success: #22c686;
    --warning: #ffa726;
    --error: #ea578b;
    --border-color: rgba(255, 255, 255, 0.15);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --active-bg: rgba(0, 212, 255, 0.15);
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 96px;
}

/* Светлая тема */
body.light-theme {
    /* Градиенты - адаптируем для светлого фона */
    --primary-gradient: linear-gradient(45deg, #0099cc, #ff1744);
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    
    /* Стекломорфизм для светлой темы */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --select: #ffffff;
    --close-bg: rgb(220, 225, 230);
    --glass-border: rgba(0, 0, 0, 0.08);
    
    /* Текст - инвертируем */
    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.85);
    --text-muted: rgba(26, 26, 46, 0.6);
    
    /* Акцентные цвета - делаем чуть глубже для контраста */
    --accent-blue: #0099cc;
    --accent-pink: #ff1744;
    
    /* Статусные цвета - адаптируем для светлого фона */
    --success: #00a86b;
    --warning: #ff8c00;
    --error: #dc3545;
    
    /* Границы и фоны */
    --border-color: rgba(0, 0, 0, 0.1);
    --hover-bg: rgba(0, 0, 0, 0.04);
    --active-bg: rgba(0, 153, 204, 0.12);
}

/* Плавный переход при смене темы */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Адаптация основных элементов */
body.light-theme {
    background: var(--bg-gradient);
    color: var(--text-primary);
}

/* Адаптация карточек для светлой темы */
body.light-theme .card {
    background: var(--glass-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Адаптация инпутов и селектов */
body.light-theme input,
body.light-theme select,
body.light-theme textarea {
    background: #ffffff;
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 153, 204, 0.2);
}

/* Частицы менее заметны на светлом фоне */
body.light-theme .particles {
    opacity: 0.3;
}

/* Переключатель темы в меню */
.theme-toggle .nav-link {
    cursor: pointer;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--base-font-size);
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    overflow-x: hidden;
}

body {
    font-size: var(--font-size-body);
}

/* === Фоновые частицы === */
.particles {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    animation: float 8s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* === Layout === */
.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

/* === Main Content === */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 14px rgba(123, 85, 239, 0.07);
}

.page-title h1 {
    font-size: var(--font-size-heading-2);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: var(--font-size-tiny);
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* === Базовые карточки === */
.card {
    background: var(--glass-bg);
    /*backdrop-filter: blur(20px);*/
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

.card-title {
    font-size: var(--font-size-heading-3);
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: var(--font-size-body);
}

/* === Базовые кнопки === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.3);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
}

.btn-danger {
    background: linear-gradient(45deg, #ea578b, #fa7070);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(234, 87, 139, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--font-size-tiny);
}

.btn-lg {
    padding: 14px 24px;
    font-size: var(--font-size-base);
}

/* === Фильтры === */
.filters-container {
    margin-bottom: 24px;
}

.filters-row {
    display: flex;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.filter-nav {
    display: flex;
    gap: 6px;
    min-width: 150px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.filter-group.date-custom {
    min-width: 200px;
    display: none;
}

.filter-group.date-custom.show {
    display: flex;    
}

.filter-label {
    font-size: var(--font-size-tiny);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select, .filter-input {
    padding: 10px 12px;
    background: var(--select);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.date-range-container {
    display: none;
    gap: 8px;
    align-items: center;
}

.date-range-container.show {
    display: flex;
    min-width: 200px;
    flex-wrap: wrap;
}


/* ========== УВЕДОМЛЕНИЯ (собственные для streams) ========== */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease forwards;
    position: relative;
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-error {
    border-left: 4px solid var(--error);
}

.notification-info {
    border-left: 4px solid var(--accent-blue);
}

.notification-warning {
    border-left: 4px solid var(--warning);
}

.notification-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--font-size-lg);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* ========== АНИМАЦИИ ========== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}


/* === Загрузка === */
.loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s ease-in-out infinite;
}

.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Пустое состояние === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-subtext {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: var(--font-size-body);
}

.empty-state-actions {
    margin-top: 20px;
}

/* === МЕДИА-ЗАПРОСЫ ДЛЯ АДАПТИВНОГО МАСШТАБИРОВАНИЯ === */
@media (max-width: 1200px) {
    :root {
        --base-font-size: 15px;
    }
}

@media (max-width: 768px) {
    :root {
        --base-font-size: 14px;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .page-content {
        padding: 20px;
    }
    
    .top-header {
        padding: 16px 20px;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-nav {
        flex-direction: column;
        align-items: stretch;       
    }
    
    .filter-group {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    :root {
        --base-font-size: 13px;
    }
}

/* === УТИЛИТАРНЫЕ КЛАССЫ ДЛЯ РАЗМЕРОВ === */
.text-xs { font-size: var(--font-size-xs) !important; }
.text-sm { font-size: var(--font-size-sm) !important; }
.text-base { font-size: var(--font-size-base) !important; }
.text-md { font-size: var(--font-size-md) !important; }
.text-lg { font-size: var(--font-size-lg) !important; }
.text-xl { font-size: var(--font-size-xl) !important; }
.text-2xl { font-size: var(--font-size-2xl) !important; }
.text-3xl { font-size: var(--font-size-3xl) !important; }
.text-4xl { font-size: var(--font-size-4xl) !important; }

/* === КЛАССЫ ДЛЯ МАСШТАБИРОВАНИЯ === */
.font-scale-90 { --base-font-size: 14.4px; }
.font-scale-110 { --base-font-size: 17.6px; }
.font-scale-120 { --base-font-size: 19.2px; }
.font-scale-130 { --base-font-size: 20.8px; }