/* ========================================
   MODERN SCHOOL MANAGEMENT SYSTEM CSS
   Professional | Clean | Responsive
   ======================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ========================================
   GLOBAL STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1a1a2e;
}

/* ========================================
   PAGE CONTAINER & LAYOUT
   ======================================== */
.page-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    background: #f8fafc;
    padding: 25px 30px;
    overflow-x: auto;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.page-header .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h3 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}

.login-header p {
    color: #6c757d;
    font-size: 14px;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.4);
}

/* ========================================
   SIDEBAR STYLES
   ======================================== */
.sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    min-height: 100vh;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    width: 280px;
}

.sidebar .brand {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.sidebar .brand h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar .brand small {
    font-size: 11px;
    opacity: 0.6;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 0 15px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.sidebar-nav a i {
    width: 22px;
    font-size: 18px;
    text-align: center;
}

.sidebar-nav a:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #ffffff;
    transform: translateX(5px);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.sidebar-nav a.logout-link {
    margin-top: 20px;
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
}

.sidebar-nav a.logout-link:hover {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.sidebar-nav .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 15px 0;
}

.sidebar-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 15px;
    font-size: 11px;
    opacity: 0.5;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0 20px;
}

/* ========================================
   STATISTICS CARDS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.blue::before { background: linear-gradient(180deg, #667eea 0%, #764ba2 100%); }
.stat-card.green::before { background: linear-gradient(180deg, #11998e 0%, #38ef7d 100%); }
.stat-card.orange::before { background: linear-gradient(180deg, #f12711 0%, #f5af19 100%); }
.stat-card.purple::before { background: linear-gradient(180deg, #b224ef 0%, #7579ff 100%); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card p {
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

/* ========================================
   CARD STYLES
   ======================================== */
.card {
    background: white;
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 25px;
    font-weight: 600;
    font-size: 18px;
}

.card-header.bg-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; color: white; }
.card-header.bg-success { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important; color: white; }
.card-header.bg-warning { background: linear-gradient(135deg, #f12711 0%, #f5af19 100%) !important; color: white; }
.card-header.bg-info { background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%) !important; color: white; }

.card-body {
    padding: 25px;
}

/* ========================================
   TABLE STYLES
   ======================================== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: #f1f5f9;
    padding: 15px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* ========================================
   BUTTON STYLES
   ======================================== */
.btn {
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a0 100%);
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    border: none;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f12711 0%, #f5af19 100%);
    border: none;
    color: white;
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-control, .form-select {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #2d3748;
}

/* ========================================
   ALERT STYLES
   ======================================== */
.alert {
    border: none;
    border-radius: 16px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
    color: #1a5b2e;
}

.alert-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #0c5460;
}

/* ========================================
   MODAL STYLES
   ======================================== */
.modal-content {
    border: none;
    border-radius: 24px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 25px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 20px 25px;
}

/* ========================================
   REPORT CARD STYLES
   ======================================== */
.report-card {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.1);
}

.report-header {
    text-align: center;
    border-bottom: 3px solid #667eea;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.report-header .school-name {
    font-size: 28px;
    font-weight: 800;
    color: #667eea;
}

.report-header .report-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: inline-block;
    padding: 5px 30px;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    margin-top: 10px;
}

/* ========================================
   MOBILE MENU & RESPONSIVE
   ======================================== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #667eea;
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Tablet & Mobile Styles */
@media (max-width: 992px) {
    .sidebar {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
        padding: 15px;
        margin-top: 60px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        min-width: 500px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Small phones */
@media (max-width: 576px) {
    .main-content {
        padding: 10px;
        margin-top: 55px;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .stat-card h3 {
        font-size: 24px;
    }
    
    .card-header {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .sidebar, .no-print, .btn, .modal, .mobile-menu-btn, .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
        background: white;
    }
    
    .report-card {
        box-shadow: none;
        padding: 0;
    }
    
    .table thead th {
        background: #f0f0f0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ========================================
   ANIMATIONS & SCROLLBAR
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}