/* ========================================
   MindWorld LMS — Общие стили
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
    --primary: #FF7C00;        /* Ваш оранжевый */
    --primary-dark: #E67000;
    --primary-light: #FF9D40;
    --khaki: #7d733a;          /* Новый цвет для текста и ховера */
    --accent: #2E7D32;         /* Зеленый School */
    --accent-dark: #00B5B0;
    --danger: #FF6B6B;
    --danger-dark: #EE5A5A;
    --warning: #FDCB6E;
    --warning-dark: #F0B429;
    --success: #00B894;
    --success-dark: #00A381;
    --bg: #FDFCF5;             /* Светлый фон из кабинета */
    --bg-card: #FFFFFF;
    --bg-dark: #2D3436;
    --text: #2D3436;
    --text-light: #636E72;
    --text-muted: #B2BEC3;
    --border: #DFE6E9;
    --shadow: 0 2px 12px rgba(255, 124, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(255, 124, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== ЛОГИН ========== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #FF7C00 0%, #FF9D40 100%); /* Оранжевый градиент */
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
    text-align: center;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

/* Увеличенный логотип на входе */
.login-logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 16px;
    object-fit: contain;
}

.login-logo h1 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 4px;
}

.login-logo h1 span.orange { color: var(--primary); }
.login-logo h1 span.green { color: var(--accent); margin-left: 4px; }

.login-subtitle {
    color: var(--khaki); /* Текст "Увійдіть у свій кабінет" */
    font-size: 15px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 800;
    font-size: 13px;
    color: var(--khaki) !important; /* Цвет меток Email и Пароль */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
}

/* ========== КНОПКИ ========== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #FF7C00 !important; /* Оранжевый фон */
    color: white !important;         /* Белый текст */
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 124, 0, 0.2);
}

.btn-primary:hover {
    background: var(--khaki) !important; /* Цвет #7d733a при наведении */
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Ниже сохранены все остальные оригинальные стили */

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-success {
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ========== СООБЩЕНИЯ ========== */
.error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: #FFF5F5;
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #FED7D7;
}

.warning-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: #FFFBEB;
    color: var(--warning-dark);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #FEF3C7;
}

.success-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: #F0FFF4;
    color: var(--success);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #C6F6D5;
}

/* ========== АДМИН-ПАНЕЛЬ LAYOUT ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: white;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
}

/* Стили для логотипа в сайдбаре (Admin/Teacher) */
.sb-logo {
    padding: 20px;
    display: flex;
    flex-direction: column; /* Текст под лого */
    align-items: center;
    text-align: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sb-logo img {
    width: 80px; /* Увеличен по вашей просьбе */
    height: 80px;
    border-radius: 50%;
    object-fit: contain;
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 800;
}

.sidebar-header .admin-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    margin-top: 8px;
}

.sidebar-nav {
    list-style: none;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav li a .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-logout {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logout button {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-logout button:hover {
    background: var(--danger);
}

.admin-main {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.admin-main h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text);
}

/* ========== КАРТОЧКИ-СТАТИСТИКА ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}

/* ========== ТАБЛИЦА ========== */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.table-header h2 {
    font-size: 18px;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 24px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

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

tr:hover {
    background: rgba(255, 124, 0, 0.02);
}

/* ========== БЕЙДЖИ ========== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-admin { background: #EDE7F6; color: #6C5CE7; }
.badge-teacher { background: #E0F7FA; color: #00897B; }
.badge-student { background: #FFF3E0; color: #F57C00; }
.badge-active { background: #E8F5E9; color: #2E7D32; }
.badge-expired { background: #FFEBEE; color: #C62828; }
.badge-monthly { background: #E3F2FD; color: #1565C0; }
.badge-yearly { background: #F3E5F5; color: #7B1FA2; }

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
}

.modal .form-group {
    margin-bottom: 16px;
}

.modal .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    outline: none;
    background: white;
    cursor: pointer;
}

.modal .form-group select:focus {
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ========== УТИЛИТЫ ========== */
.hidden { display: none !important; }

.text-center { text-align: center; }

.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ========== АНИМАЦИИ ========== */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== АДАПТИВ ========== */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        padding: 16px 0;
    }
    
    .admin-main {
        padding: 20px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 10px 12px;
    }
}
