/* Custom styles for the school management system */

/* Global please-wait overlay */
.app-wait-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background:
        radial-gradient(circle at 35% 25%, rgba(39, 176, 222, 0.22), transparent 30%),
        linear-gradient(135deg, rgba(6, 20, 35, 0.82), rgba(9, 42, 66, 0.72));
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-wait-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-wait-card {
    width: min(300px, 92vw);
    padding: 28px 24px;
    text-align: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.app-wait-spinner {
    width: 86px;
    height: 30px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.app-wait-spinner span {
    width: 16px;
    height: 16px;
    display: block;
    border-radius: 50%;
    background: #138ec1;
    animation: appWaitPulse 0.85s ease-in-out infinite;
}

.app-wait-spinner span:nth-child(2) {
    animation-delay: 0.12s;
    background: #20b486;
}

.app-wait-spinner span:nth-child(3) {
    animation-delay: 0.24s;
    background: #f2b705;
}

.app-wait-title {
    font-size: 22px;
    font-weight: 700;
    color: #123047;
    line-height: 1.15;
}

.app-wait-message {
    margin-top: 7px;
    color: #587084;
    font-size: 14px;
}

@keyframes appWaitPulse {
    0%, 80%, 100% {
        transform: translateY(0) scale(0.86);
        opacity: 0.52;
    }
    40% {
        transform: translateY(-9px) scale(1);
        opacity: 1;
    }
}

/* Login page background */
body.login-page {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(7, 21, 38, 0.58), rgba(10, 38, 63, 0.18)),
        url("../img/login-id-card-bg.png") center center / cover no-repeat fixed;
}

body.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.22), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(8, 23, 40, 0.16));
    pointer-events: none;
}

body.login-page .login-box {
    position: relative;
    z-index: 1;
}

body.login-page .login-box .card {
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 24px 60px rgba(5, 18, 32, 0.25);
    backdrop-filter: blur(10px);
}

/* Fix sidebar scroll */
.wrapper .sidebar {
    overflow-y: auto;
}

/* Photo preview in forms */
#photoPreview {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    padding: 5px;
}

/* Cropper container */
.cropper-container {
    max-height: 400px;
}

/* ID card preview */
#cardPreview {
    width: 400px;
    height: 250px;
    background: #f8f9fa;
    border: 2px dashed #6c757d;
    position: relative;
    margin: 20px auto;
    overflow: hidden;
}
.field-draggable {
    position: absolute;
    cursor: move;
    padding: 2px 8px;
    background: rgba(255,255,255,0.8);
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: 12px;
    user-select: none;
    z-index: 10;
}

/* Checklist table */
.table-checklist th, .table-checklist td {
    vertical-align: middle;
    text-align: center;
}
.table-checklist .check-box {
    width: 20px;
    height: 20px;
    margin: 0 auto;
}

/* Status badges */
.badge-active {
    background-color: #28a745;
}
.badge-inactive {
    background-color: #dc3545;
}

/* DataTables custom */
.dataTables_wrapper .dataTables_filter input {
    margin-left: 5px;
    border-radius: 20px;
    padding: 0 15px;
}

/* Select2 inside modals */
.select2-container--default .select2-selection--single {
    height: 38px;
    border-radius: 4px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* Custom sidebar branding */
.main-sidebar .brand-link {
    background: #2c3e50;
}
.main-sidebar .brand-text {
    color: #fff;
}
.main-sidebar .user-panel .info a {
    color: #fff;
}
