/* Base Styles & Variables */
:root {
    --primary-color: #0b5ed7;
    --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #003e9c 100%);
    --bg-color: #f4f7fe;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #2b3674;
    --text-muted: #a3aed1;
    --border-color: #e0e5f2;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0.03) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.03) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.03) 0, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-body {
    background-color: #f8f9fc;
}

/* Header Section */
.header-section {
    background: var(--primary-gradient);
    color: white;
    padding-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255,255,255,0.2);
    position: absolute;
    bottom: 0;
    left: 0;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #fff;
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.form-container {
    margin-top: -35px;
    position: relative;
    z-index: 10;
}

.dashboard-container {
    margin-top: -35px;
    position: relative;
    z-index: 10;
}

/* Section Cards inside Form */
.section-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed var(--border-color);
}

/* Form Controls and Floating Labels */
.input-group {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
    background: #fff;
    flex-wrap: nowrap;
}

.input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    border-color: #86b7fe;
}

.input-group-text {
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    width: 44px;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    padding: 0;
}

.form-floating {
    flex-grow: 1;
    min-width: 0;
}

.form-floating > .form-control,
.form-floating > .form-select {
    border: none;
    border-radius: 0;
    box-shadow: none !important;
    background-color: transparent;
}

.form-floating > .form-select {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating > label {
    padding-left: 1rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--primary-color);
    font-weight: 500;
}

/* Custom Checkboxes */
.custom-checkbox {
    padding-left: 1.75rem;
}
.custom-checkbox .form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.15em;
    margin-left: -1.75em;
    border-color: #cbd5e1;
}

.custom-checkbox .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-checkbox .form-check-label {
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Buttons */
.custom-submit-btn {
    background: var(--primary-gradient);
    border: none;
    transition: all 0.3s ease;
}

.custom-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3) !important;
}

.custom-reset-btn {
    color: #475569;
    border: 1px solid #cbd5e1;
    background: #fff;
    transition: all 0.3s ease;
}

.custom-reset-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Validation styling override for input group */
.was-validated .form-control:valid, .form-control.is-valid,
.was-validated .form-select:valid, .form-select.is-valid {
    background-image: none;
}
.was-validated .form-control:invalid, .form-control.is-invalid,
.was-validated .form-select:invalid, .form-select.is-invalid {
    background-image: none;
}

.invalid-feedback {
    margin-left: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Table Styles for Dashboard */
.custom-table-wrapper {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
}

#reportsTable th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 1rem 0.5rem;
}

#reportsTable td {
    padding: 0.75rem 0.5rem;
    color: #334155;
    vertical-align: middle;
    font-size: 0.9rem;
}

.btn-action {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.gradient-header {
    background: var(--primary-gradient) !important;
}

/* DataTables pagination styling */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    border-radius: 8px;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(244, 247, 254, 0.7); /* Semi transparent background */
    backdrop-filter: blur(10px); /* Blur the website content behind */
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader-content {
    text-align: center;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    /* Navbar adjustments */
    .header-section {
        padding-bottom: 2rem;
    }
    
    .navbar-brand h4 {
        font-size: 1.1rem !important;
    }
    
    .navbar-brand .fa-2x {
        font-size: 1.5em;
    }
    
    .btn-light.px-3 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        font-size: 0.85rem;
    }
    
    /* Card padding */
    .section-card {
        padding: 1rem;
        margin-bottom: 1rem !important;
    }
    
    .card-body {
        padding: 1.25rem !important;
    }
    
    /* Input spacing */
    .row.g-3 > div {
        margin-bottom: 0.25rem;
    }
    
    .form-container {
        margin-top: -20px;
    }
    
    .dashboard-container {
        margin-top: -20px;
    }

    /* Table & Modal specific for mobile */
    .modal-body {
        padding: 1rem;
    }
    
    .d-flex.align-items-center > small {
        display: none;
    }
    
    .dataTables_wrapper .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .custom-table-wrapper {
        border-radius: 8px;
    }
    
    table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before, 
    table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before {
        background-color: var(--primary-color) !important;
    }
}
