/**
 * Glolight International Academy - School Management System
 * Main Stylesheet
 * Brand Colors: Red #8B1538, Blue #1E4C8F
 */

/* ============================================
   CSS Variables
============================================ */
:root {
    /* Brand Colors */
    --primary-red: #8B1538;
    --primary-red-dark: #6d1029;
    --primary-red-light: #a91d45;
    --primary-blue: #1E4C8F;
    --primary-blue-dark: #163a6d;
    --primary-blue-light: #2860b0;

    /* Neutral Colors */
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Status Colors */
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #0dcaf0;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --footer-height: 50px;

    /* Transitions */
    --transition-speed: 0.3s;

    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* ============================================
   Base Styles
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-100);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--primary-blue-dark);
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-speed);
}

.content-wrapper {
    flex: 1;
    padding: 1.5rem;
}

/* ============================================
   Sidebar
============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed);
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 70px;
    display: flex;
    align-items: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
    margin-right: 10px;
}

.sidebar-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-nav .nav-section {
    padding: 0.5rem 1.25rem;
    margin-top: 0.5rem;
}

.sidebar-nav .nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    margin-right: 12px;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-left-color: var(--primary-red);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-footer .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.75rem;
}

/* Sidebar Collapsed State */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .nav-link span {
    display: none;
}

.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-collapsed .sidebar-nav .nav-link i {
    margin-right: 0;
}

/* ============================================
   Navbar
============================================ */
.navbar {
    height: var(--header-height);
    padding: 0 1.5rem;
}

.sidebar-toggle {
    color: var(--gray-600);
    padding: 0.5rem;
}

.sidebar-toggle:hover {
    color: var(--primary-blue);
}

.navbar .input-group {
    max-width: 300px;
}

.navbar .input-group-text,
.navbar .form-control {
    border: none;
}

.navbar .form-control:focus {
    box-shadow: none;
}

/* Notification Dropdown */
.notification-dropdown {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    white-space: normal;
}

.notification-dropdown .dropdown-item.unread {
    background-color: var(--gray-50);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ============================================
   Footer
============================================ */
.footer {
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    font-size: 0.85rem;
}

/* ============================================
   Cards
============================================ */
.card {
    border: none;
    box-shadow: var(--shadow-sm);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Stats Cards */
.stats-card {
    border-radius: 0.75rem;
    overflow: hidden;
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card .stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stats-card .stats-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stats-card .stats-label {
    color: var(--gray-600);
    font-size: 0.85rem;
}

.stats-card.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: #fff;
}

.stats-card.bg-danger-gradient {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: #fff;
}

.stats-card.bg-success-gradient {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    color: #fff;
}

.stats-card.bg-warning-gradient {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: var(--gray-800);
}

/* ============================================
   Buttons
============================================ */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-blue-dark);
    border-color: var(--primary-blue-dark);
}

.btn-danger {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: var(--primary-red-dark);
    border-color: var(--primary-red-dark);
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ============================================
   Forms
============================================ */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border-color: var(--gray-300);
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(30, 76, 143, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--gray-700);
}

.input-group-text {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
}

/* ============================================
   Tables
============================================ */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--gray-700);
    border-bottom-width: 2px;
    padding: 0.75rem;
    background-color: var(--gray-50);
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--gray-50);
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    border-color: var(--gray-300);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--gray-200) !important;
    border-color: var(--gray-200) !important;
    color: var(--gray-800) !important;
}

/* ============================================
   Badges
============================================ */
.badge {
    font-weight: 500;
    padding: 0.4em 0.65em;
}

.badge.bg-primary {
    background-color: var(--primary-blue) !important;
}

.badge.bg-danger {
    background-color: var(--primary-red) !important;
}

/* ============================================
   Alerts
============================================ */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #0f5132;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #842029;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #664d03;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #055160;
}

/* ============================================
   Page Header
============================================ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--gray-600);
}

.breadcrumb-item.active {
    color: var(--gray-500);
}

/* ============================================
   Profile & Avatar
============================================ */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

.avatar-xl {
    width: 120px;
    height: 120px;
}

/* ============================================
   Utilities
============================================ */
.bg-primary-light {
    background-color: rgba(30, 76, 143, 0.1) !important;
}

.bg-danger-light {
    background-color: rgba(139, 21, 56, 0.1) !important;
}

.text-primary {
    color: var(--primary-blue) !important;
}

.text-danger {
    color: var(--primary-red) !important;
}

.border-primary {
    border-color: var(--primary-blue) !important;
}

.fw-medium {
    font-weight: 500;
}

.cursor-pointer {
    cursor: pointer;
}

/* ============================================
   Login Page
============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.login-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ============================================
   Installation Wizard
============================================ */
.install-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    padding: 2rem;
}

.install-card {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.install-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: #fff;
    padding: 2rem;
    text-align: center;
    border-radius: 1rem 1rem 0 0;
}

.install-header img {
    width: 80px;
    margin-bottom: 1rem;
}

.install-body {
    padding: 2rem;
}

.install-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.install-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.install-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.install-step.active .install-step-number {
    background: var(--primary-blue);
    color: #fff;
}

.install-step.completed .install-step-number {
    background: var(--success);
    color: #fff;
}

.install-step-label {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* ============================================
   Report Card Styles
============================================ */
.report-card {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
}

.report-card-header {
    text-align: center;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.report-card-header img {
    height: 80px;
    margin-bottom: 10px;
}

.report-card-header h1 {
    color: var(--primary-red);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.report-card-header p {
    margin: 0;
    font-size: 0.9rem;
}

.report-card-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.report-card-table th,
.report-card-table td {
    border: 1px solid var(--gray-300);
    padding: 8px 12px;
    text-align: left;
}

.report-card-table th {
    background: var(--gray-100);
    font-weight: 600;
}

/* ============================================
   Print Styles
============================================ */
@media print {
    .sidebar,
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-wrapper {
        padding: 0 !important;
    }

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

/* ============================================
   Responsive
============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .stats-card .stats-value {
        font-size: 1.5rem;
    }

    .login-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }
}

/* ============================================
   Dark Mode (Future)
============================================ */
@media (prefers-color-scheme: dark) {
    /* Can be expanded for dark mode support */
}
