/* ============================================================
   School Management System – Modern, Clean & Aligned UI
   ============================================================ */

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

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: #f4f7fc;
    color: #1e293b;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========== TOP NAVBAR (Black) ========== */
.navbar-dark.bg-dark {
    background: #111827 !important;
}
.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
    color: #f1f5f9 !important;
    font-weight: 500;
}
.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
    color: #60a5fa !important;
}
.navbar-dark .dropdown-menu {
    background: #1f2937;
    border: none;
}
.navbar-dark .dropdown-item {
    color: #f1f5f9;
}
.navbar-dark .dropdown-item:hover {
    background: #374151;
    color: #fff;
}

/* ========== CONTENT AREA ========== */
.content {
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 1.5rem 1rem;
}

/* ========== CARDS ========== */
.card {
    border: none;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
}
.card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

/* ========== BUTTONS ========== */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}
.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}
.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* ========== TABLES ========== */
.table {
    border-radius: 8px;
    overflow: hidden;
    width: 100% !important;
    white-space: nowrap; /* keep single-line headings */
}
.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 0.75rem;
}
.table td, .table th {
    vertical-align: middle;
    padding: 0.6rem 0.75rem;
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8fafc;
}
.table-hover tbody tr:hover {
    background-color: #e2e8f0;
}

/* Responsive tables: allow horizontal scroll on small screens */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== FORMS – FIX TEXT OVERFLOW / ALIGNMENT ========== */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    /* Ensure text inside does not overflow */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.form-control:focus, .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96,165,250,0.2);
    outline: none;
}

/* For textareas (multi‑line) override white‑space */
textarea.form-control {
    white-space: normal;
    overflow: auto;
    min-height: 60px;
}

/* Small input variant */
.form-control-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Checkboxes and radios */
.form-check-input {
    margin-top: 0.3rem;
    transform: scale(1.1);
}
.form-check-label {
    margin-left: 0.25rem;
    font-weight: 500;
}

/* ========== MODAL ========== */
.modal-content {
    border-radius: 12px;
    border: none;
}

/* ========== ALERTS ========== */
.alert {
    border-radius: 8px;
    font-size: 0.95rem;
}

/* ========== DATATABLES ========== */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.5rem;
}
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 0.3rem 0.6rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 767px) {
    .content {
        padding: 1rem 0.75rem;
    }
    .btn {
        width: 100%;
        margin-bottom: 0.3rem;
    }
    .navbar .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
    .card-body {
        padding: 1rem;
    }
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    /* Allow table cells to wrap on mobile */
    .table td, .table th {
        white-space: normal;
        word-break: break-word;
    }
    /* Make DataTables horizontal scroll */
    .dataTables_wrapper .table-responsive {
        overflow-x: auto;
    }
}

#liveDateTime {
    font-weight: 500;
    letter-spacing: 0.5px;
}