/* ═══════════════════════════════════════════════════════════════
   СОВРЕМЕННАЯ СИСТЕМА ШКОЛЬНЫХ РЕЙТИНГОВ - ГЛАВНЫЕ СТИЛИ
   ═══════════════════════════════════════════════════════════════ */

@import url("/assets/vendor/fonts/google-fonts.css");

:root {
    /* Основные цвета */
    --primary-orange: #FF6B35;
    --primary-orange-light: #FF8C61;
    --primary-orange-dark: #E65A2F;
    --secondary-orange: #F7931E;
    
    --primary-blue: #4F46E5;
    --primary-blue-light: #6366F1;
    --primary-blue-dark: #4338CA;
    
    --primary-green: #10B981;
    --primary-green-light: #34D399;
    --primary-green-dark: #059669;
    
    --primary-purple: #8B5CF6;
    --primary-purple-light: #A78BFA;
    
    /* Нейтральные цвета */
    --dark: #1E293B;
    --dark-light: #334155;
    --gray: #64748B;
    --gray-light: #94A3B8;
    --gray-lighter: #CBD5E1;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    
    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-orange: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    --gradient-blue: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --gradient-green: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-sunset: linear-gradient(135deg, #FA709A 0%, #FEE140 100%);
    --gradient-ocean: linear-gradient(135deg, #667eea 0%, #4F46E5 100%);
    
    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.3);
    
    /* Анимации */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Радиусы */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
}

/* ═══════════════════════════════════════════════════════════════
   БАЗОВЫЕ СТИЛИ
   ═══════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-primary);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Анимация фона */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ═══════════════════════════════════════════════════════════════
   СТЕКЛЯННЫЙ МОРФИЗМ (GLASSMORPHISM)
   ═══════════════════════════════════════════════════════════════ */

.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.glass-dark {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   КАРТОЧКИ
   ═══════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 107, 53, 0.03) 100%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.card-gradient {
    background: var(--gradient-orange);
    color: white;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform var(--transition-smooth);
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateY(-10px);
}

/* ═══════════════════════════════════════════════════════════════
   КНОПКИ
   ═══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-orange);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
}

.btn-success {
    background: var(--gradient-green);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

.btn-info {
    background: var(--gradient-blue);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(79, 70, 229, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--dark);
    border: 2px solid var(--gray-lighter);
}

.btn-ghost:hover {
    background: var(--bg-light);
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}

/* ═══════════════════════════════════════════════════════════════
   ТАБЛИЦЫ
   ═══════════════════════════════════════════════════════════════ */

.table-container {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

.table th {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th:first-child {
    border-top-left-radius: 1.5rem;
}

.table th:last-child {
    border-top-right-radius: 1.5rem;
}

.table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E2E8F0;
    transition: all var(--transition-base);
    background: white;
    color: #1E293B;
    font-size: 0.9375rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: all var(--transition-base);
    background: white;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.03) 0%, transparent 100%);
    transform: scale(1.005);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 1.5rem;
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   ФОРМЫ
   ═══════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition-base);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   УВЕДОМЛЕНИЯ (ALERTS)
   ═══════════════════════════════════════════════════════════════ */

.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideDown 0.3s ease-out;
    font-weight: 500;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: var(--primary-green-dark);
    border-left: 4px solid var(--primary-green);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #DC2626;
    border-left: 4px solid #EF4444;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: #D97706;
    border-left: 4px solid #F59E0B;
}

.alert-info {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(79, 70, 229, 0.05) 100%);
    color: var(--primary-blue-dark);
    border-left: 4px solid var(--primary-blue);
}

/* ═══════════════════════════════════════════════════════════════
   АНИМАЦИИ
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

/* ═══════════════════════════════════════════════════════════════
   УТИЛИТЫ
   ═══════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-gradient {
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

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

.badge-success {
    background: var(--gradient-green);
    color: white;
}

.badge-info {
    background: var(--gradient-blue);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   МОДАЛЬНЫЕ ОКНА
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.modal {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-lighter);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--primary-orange);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    margin-bottom: 2rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gray-lighter);
}

/* ═══════════════════════════════════════════════════════════════
   АДАПТИВНОСТЬ
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .card {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .modal {
        padding: 2rem 1.5rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   СКЕЛЕТНАЯ ЗАГРУЗКА (SKELETON LOADING)
   ═══════════════════════════════════════════════════════════════ */

.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
    color: transparent !important;
    pointer-events: none;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 1em; margin-bottom: 0.5rem; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card { height: 120px; }

/* ═══════════════════════════════════════════════════════════════
   СПИННЕР ЗАГРУЗКИ
   ═══════════════════════════════════════════════════════════════ */

.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(255, 107, 53, 0.2);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spinner-spin 0.7s linear infinite;
    vertical-align: middle;
}

.spinner-sm { width: 1rem; height: 1rem; border-width: 2px; }
.spinner-lg { width: 2.5rem; height: 2.5rem; border-width: 4px; }

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

/* ═══════════════════════════════════════════════════════════════
   ДОСТУПНОСТЬ: FOCUS-VISIBLE
   ═══════════════════════════════════════════════════════════════ */

:focus-visible {
    outline: 3px solid var(--primary-orange);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Убираем стандартный outline только при использовании мыши */
:focus:not(:focus-visible) {
    outline: none;
}

/* ═══════════════════════════════════════════════════════════════
   УТИЛИТЫ FLEXBOX/GRID
   ═══════════════════════════════════════════════════════════════ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex-1 { flex: 1; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ═══════════════════════════════════════════════════════════════
   УТИЛИТЫ ОТСТУПОВ
   ═══════════════════════════════════════════════════════════════ */

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* ═══════════════════════════════════════════════════════════════
   УТИЛИТЫ ТЕКСТА
   ═══════════════════════════════════════════════════════════════ */

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-muted { color: var(--gray); }
.text-success { color: var(--primary-green); }
.text-danger { color: #EF4444; }
.text-warning { color: #F59E0B; }
.text-primary { color: var(--primary-orange); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════
   РАЗДЕЛИТЕЛЬ И ВСПОМОГАТЕЛЬНЫЕ ЭЛЕМЕНТЫ
   ═══════════════════════════════════════════════════════════════ */

.divider {
    border: none;
    border-top: 1px solid var(--gray-lighter);
    margin: 1.5rem 0;
}

.divider-vertical {
    border: none;
    border-left: 1px solid var(--gray-lighter);
    height: 1.5rem;
    display: inline-block;
    margin: 0 0.75rem;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════
   ПУСТОЕ СОСТОЯНИЕ (EMPTY STATE)
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark-light);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.9375rem;
    color: var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   СТИЛИ ДЛЯ ПЕЧАТИ
   ═══════════════════════════════════════════════════════════════ */

@media print {
    .no-print,
    .navbar,
    .btn,
    #back-to-top,
    #toast-container {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .table th {
        background: #4F46E5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a[href]::after {
        content: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR КАСТОМНЫЙ
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-lighter);
    border-radius: 4px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   ДОПОЛНИТЕЛЬНАЯ АДАПТИВНОСТЬ
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 1.5rem 1rem;
        border-radius: var(--radius-lg);
    }

    .btn {
        padding: 0.625rem 1rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
