/* ============================================
   ACADEMY MANAGEMENT - CLEAN DESIGN SYSTEM
   Colors: Blue, White, Black, Red, Green
   Flat Design | App-Like | Smooth Animations
   ============================================ */

/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== ROOT VARIABLES ===== */
:root {
    /* Primary Colors - SOLID */
    --primary: #1a73e8;
    --primary-dark: #0d47a1;
    --primary-light: #e8f0fe;
    --primary-hover: #1557b0;
    
    /* Neutral Colors */
    --white: #ffffff;
    --black: #000000;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Accent Colors - SOLID */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Shadows - Subtle */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    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 pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.4s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.4s ease forwards;
}

.scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* Stagger children animations */
.stagger > * {
    opacity: 0;
}

.stagger > *:nth-child(1) { animation: slideInUp 0.3s ease 0.05s forwards; }
.stagger > *:nth-child(2) { animation: slideInUp 0.3s ease 0.10s forwards; }
.stagger > *:nth-child(3) { animation: slideInUp 0.3s ease 0.15s forwards; }
.stagger > *:nth-child(4) { animation: slideInUp 0.3s ease 0.20s forwards; }
.stagger > *:nth-child(5) { animation: slideInUp 0.3s ease 0.25s forwards; }
.stagger > *:nth-child(6) { animation: slideInUp 0.3s ease 0.30s forwards; }
.stagger > *:nth-child(7) { animation: slideInUp 0.3s ease 0.35s forwards; }
.stagger > *:nth-child(8) { animation: slideInUp 0.3s ease 0.40s forwards; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    padding: 20px;
    position: relative;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 35px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: scaleIn 0.5s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .logo-icon {
    width: 70px;
    height: 70px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 30px;
    animation: pulse 2s infinite;
}

.login-logo h2 {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--gray-600);
    font-size: 14px;
}

.login-card .form-control {
    height: 48px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    font-size: 14px;
    transition: var(--transition-fast);
    background: var(--white);
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.login-card .form-control.is-invalid {
    border-color: var(--danger);
}

.login-card .btn-primary {
    height: 48px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition-fast);
}

.login-card .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.3);
}

.login-card .btn-primary:active {
    transform: scale(0.98);
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-600);
    background: none;
    border: none;
    padding: 5px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    width: 280px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
    overflow-y: auto;
    border-right: 1px solid var(--gray-200);
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 18px 20px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 65px;
}

.sidebar-header .brand {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .brand i {
    font-size: 24px;
}

.sidebar-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-close:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-menu {
    list-style: none;
    padding: 12px 0;
    margin: 0;
}

.sidebar-menu .menu-label {
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    font-weight: 600;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
    font-size: 14px;
    position: relative;
}

.sidebar-menu li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-menu li.active a {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-menu li.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}

.sidebar-menu li a i {
    width: 22px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu li a .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
}

/* ===== MOBILE OVERLAY ===== */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
}

.mobile-overlay.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===== NAVBAR ===== */
.navbar-top {
    background: var(--white);
    padding: 12px 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid var(--gray-200);
}

.navbar-top .brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--gray-900);
}

.navbar-top .brand i {
    color: var(--primary);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 22px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
}

.nav-icon {
    position: relative;
    color: var(--gray-700);
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon:hover {
    background: var(--gray-100);
}

.nav-icon .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 0;
    padding: 20px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 992px) {
    .sidebar {
        left: 0 !important;
    }
    
    .sidebar-close {
        display: none !important;
    }
    
    .mobile-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 280px;
        padding: 25px 30px;
    }
}

body.sidebar-open {
    overflow: hidden;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    margin-bottom: 20px;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ===== STATS CARDS ===== */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border-left: 4px solid var(--primary);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-card .stat-icon.blue { background: var(--primary); }
.stat-card .stat-icon.green { background: var(--success); }
.stat-card .stat-icon.red { background: var(--danger); }
.stat-card .stat-icon.yellow { background: var(--warning); }

.stat-card .stat-number {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card .stat-label {
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== TABLES ===== */
.table-container {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-container .table-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.table-container .table-header h5 {
    font-weight: 600;
    margin: 0;
    color: var(--gray-800);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    padding: 12px 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-color: var(--gray-200);
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--primary-light);
}

/* ===== BADGES ===== */
.badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 11px;
}

.badge-success { background: var(--success); color: white; }
.badge-danger { background: var(--danger); color: white; }
.badge-warning { background: var(--warning); color: var(--gray-900); }
.badge-primary { background: var(--primary); color: white; }
.badge-info { background: var(--info); color: white; }
.badge-secondary { background: var(--gray-500); color: white; }

/* ===== FORMS ===== */
.form-control, .form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 14px;
    transition: var(--transition-fast);
    background: var(--white);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control.is-invalid {
    border-color: var(--danger);
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    border: none;
    animation: slideInUp 0.3s ease;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info { background: #d1ecf1; color: #0c5460; }

/* ===== MODAL ===== */
.modal-content {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease;
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 16px 20px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 50px;
    color: var(--gray-300);
    margin-bottom: 15px;
}

.empty-state h5 {
    font-weight: 600;
    color: var(--gray-700);
}

.empty-state p {
    color: var(--gray-500);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .main-content {
        padding: 15px;
    }
    
    .stat-card .stat-number {
        font-size: 22px;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .login-logo .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .navbar-top {
        padding: 10px 15px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .table-container .table-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .table-responsive-wrapper {
        overflow-x: auto;
    }
    
    .card-body {
        padding: 15px;
    }
}

/* ===== LOADING SPINNER ===== */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== UTILITY ===== */
.text-primary { color: var(--primary !important); }
.text-success { color: var(--success !important); }
.text-danger { color: var(--danger !important); }
.text-warning { color: var(--warning !important); }
.text-muted { color: var(--gray-600 !important); }

.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-light { background: var(--gray-100) !important; }
.bg-white { background: var(--white) !important; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }

.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* ===== PRINT ===== */
@media print {
    .no-print { display: none !important; }
    .sidebar { display: none !important; }
    .navbar-top { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 20px !important; }
    .card { box-shadow: none !important; border: 1px solid var(--gray-200) !important; }
}