/* Custom styles for Admin section */

/* Admin Login Page Specific Styles */
body.auth-page {
    background: #e9ecef; /* Light gray background, typical for AdminLTE */
    font-family: 'Source Sans Pro', sans-serif; /* Align with AdminLTE font */
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container {
    max-width: 400px; /* Slightly narrower */
    padding: 2.5rem; /* Standard padding */
    background-color: #ffffff;
    border-radius: 0.5rem; /* AdminLTE default radius */
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2); /* AdminLTE shadow */
    border-top: 3px solid #007bff; /* Primary color top border for branding */
}

.auth-container h2 {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1.8rem; /* Slightly smaller for professional look */
    color: #495057; /* AdminLTE text color */
    margin-bottom: 1.5rem;
}

.auth-container .form-group {
    margin-bottom: 1rem; /* Reduced margin */
}

.auth-container .form-control {
    height: 40px; /* Standard input height */
    border-color: #ced4da;
    border-radius: 0.25rem; /* Slightly less rounded */
    background-color: #fff;
    color: #495057;
}

.auth-container .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25); /* Bootstrap focus shadow */
}

.auth-container .form-group label {
    color: #6c757d; /* Muted label color */
    font-size: 0.9rem; /* Smaller label font */
    position: relative; /* Labels above inputs, not floating */
    transform: none;
    top: auto;
    left: auto;
    padding: 0;
    margin-bottom: 0.5rem;
    display: block;
    pointer-events: auto;
    z-index: auto;
    background-color: transparent;
}

/* Remove placeholder-shown effect as labels are no longer floating */
.auth-container .form-control:focus + label,
.auth-container .form-control:not(:placeholder-shown) + label {
    top: auto;
    left: auto;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: normal;
    background-color: transparent;
}


.auth-container .btn-primary {
    background-color: #007bff; /* AdminLTE primary blue */
    border-color: #007bff;
    font-weight: 600; /* Semi-bold */
    letter-spacing: 0; /* Remove extra letter spacing */
    text-transform: none; /* No uppercase */
    padding: 0.75rem 1.25rem; /* Standard button padding */
    border-radius: 0.25rem;
    box-shadow: none;
}

.auth-container .btn-primary:hover {
    background-color: #0056b3; /* Darker blue on hover */
    border-color: #0056b3;
    transform: none; /* Remove hover transform */
    box-shadow: none;
}

.alert-danger, .alert-success {
    margin-bottom: 1rem; /* Adjust alert margin */
}

.text-center.mt-3 a {
    color: #007bff;
}

.text-center.mt-3 a:hover {
    color: #0056b3;
}

/* General Admin Layout & Component Styles (beyond login) */
body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: #f4f6f9; /* Lighter background for dashboard */
    color: #343a40;
}

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

.content-wrapper {
    background-color: #f4f6f9;
    padding: 20px;
    flex-grow: 1;
}

.card {
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
    background-color: #fff;
    border: none; /* Remove default card border */
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: 0.75rem 1.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #343a40;
}

.card-body {
    padding: 1.25rem;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #343a40;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa; /* Light header background */
    color: #495057;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f2f2f2; /* Light hover effect */
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05); /* Lighter blue hover for general tables */
}

/* Badges for Status */
.badge {
    padding: 0.4em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    display: inline-block;
}

.badge-pending { background-color: #ffc107; color: #343a40; } /* Warning yellow */
.badge-under_review { background-color: #17a2b8; color: #fff; } /* Info blue */
.badge-assigned { background-color: #6f42c1; color: #fff; } /* Purple */
.badge-in_progress { background-color: #007bff; color: #fff; } /* Primary blue */
.badge-completed { background-color: #28a745; color: #fff; } /* Success green */
.badge-rejected { background-color: #dc3545; color: #fff; } /* Danger red */

/* Modals */
.modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    border: none;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.modal-title {
    font-weight: 600;
    color: #343a40;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Form controls within modals */
.modal-body .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.modal-body .form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Communication Log */
.message-log {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.message-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 0.25rem;
}

.message-item.bg-light {
    background-color: #e2f3ff !important; /* Light blue for user messages */
    border-color: #cce5ff !important;
    text-align: right;
}

.message-item.bg-white {
    background-color: #ffffff !important; /* White for staff messages */
    border-color: #dee2e6 !important;
    text-align: left;
    box-shadow: 0 1px 1px rgba(0,0,0,.05);
}

.message-item small {
    display: block;
    margin-bottom: 5px;
    color: #6c757d;
}

.message-item p {
    margin-bottom: 0;
    word-wrap: break-word;
}

/* Ensure sidebar content scrolls if it's too long */
.main-sidebar .sidebar {
    max-height: calc(100vh - (5rem + 1rem)); /* Adjust based on header/brand link height and potential padding */
    overflow-y: auto;
}

/* Pagination */
.pagination .page-item .page-link {
    color: #007bff;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.table-actions .btn {
    margin-right: 5px;
}

/* === PAGE LOADER === */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f4f6f9; /* Admin background color */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 123, 255, 0.2); /* Admin primary blue with opacity */
    border-top: 5px solid #007bff; /* Admin primary blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
