/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Modern Color Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;

    /* Functional Colors */
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    /* Functional Colors */
    --bg-main: #f3f4f6; /* Lighter gray background */
    --bg-card: #ffffff;
    --bg-sidebar: #0a192f; /* Deep Navy */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);

    /* Glassmorphism & Shadows */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--bg-sidebar);
    width: 260px;
    width: 260px;
    height: calc(100vh - 70px); /* Height minus header */
    position: fixed;
    left: 0;
    top: 70px; /* Start below header */
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 1.5rem 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; /* ENABLE FLEX */
    flex-direction: column; /* VERTICAL STACK */
    overflow-y: auto;
}

.sidebar .brand {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-size: 1.75rem;
    font-weight: 800;
}

.sidebar .brand img {
    height: 50px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); /* Glow to highlight */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .brand i {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 0 50px 50px 0; /* Rounded right side */
    margin-right: 1.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    position: relative;
}

.sidebar .nav-link:hover {
    color: white;
    padding-left: 1.5rem; /* Slide effect */
}

.sidebar .nav-link.active {
    background-color: #fff9c4; /* Cream/Yellowish Active State */
    color: #0a192f !important; /* Dark Text */
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link.active i {
    color: #0a192f !important;
}

.sidebar .nav-link i {
    font-size: 1.25rem;
    transition: color 0.2s;
}

.btn-navy {
    background-color: #0a192f;
    color: white;
    border: none;
}
.btn-navy:hover {
    background-color: #1e3a8a;
    color: white;
}

.sidebar .logout-link {
    margin-top: auto;
    color: #fca5a5 !important;
}

.sidebar .logout-link:hover {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

.sidebar-header {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.5rem 0;
    padding-left: 1.25rem;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    flex: 1;
    margin-left: 260px;
    padding: 1.5rem;
    min-height: 100vh;
    margin-top: 70px; /* Push down for header */
}

/* Glass Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Dashboard Statistic Cards */
.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .info-text {
    margin-top: 1rem;
}

.stat-card .label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0;
}

/* Buttons */
.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
    transition: all 0.2s;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    color: white;
}

/* Tables */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

.premium-table thead th {
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 1rem;
}

.premium-table tbody tr {
    background: white;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    transition: transform 0.2s;
}

.premium-table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

.premium-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.premium-table td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.premium-table td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* Badges */
.badge-premium {
    padding: 0.5em 1em;
    font-weight: 600;
    border-radius: var(--radius-full);
}

/* Header Section */
.page-header {
    margin-bottom: 2.5rem;
}

.page-header h2 {
    font-weight: 800;
    color: var(--text-main);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out forwards;
}

.school-logo-wrapper {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

/* Bootstrap Overrides */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-outline-primary:hover, 
.btn-check:checked + .btn-outline-primary {
    background-color: var(--primary) !important;
    color: white !important;
}
.pagination .page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

/* Responsive Layout */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-wrapper {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    /* Overlay when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}
/* Hide number input spinners */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type='number'] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.capitalize-input {
    text-transform: capitalize;
}
