/* Custom styles for FDF Portal - AdminLTE 3 Theme */

/* ============================================
   CSS Variables / Custom Properties
   ============================================ */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-dark-bg: #343a40;
    --sidebar-dark-active: #007bff;
}

/* ============================================
   Base Styles
   ============================================ */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

a {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Card Styling
   ============================================ */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
    margin-bottom: 1rem;
}

.card-primary.card-outline {
    border-top: 3px solid var(--primary-color);
}

.card-success.card-outline {
    border-top: 3px solid var(--success-color);
}

.card-warning.card-outline {
    border-top: 3px solid var(--warning-color);
}

.card-danger.card-outline {
    border-top: 3px solid var(--danger-color);
}

.card-info.card-outline {
    border-top: 3px solid var(--info-color);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, .125);
    padding: 0.75rem 1.25rem;
}

.card-header .card-title {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-tools .btn {
    margin-left: 0.25rem;
}

/* ============================================
   Sidebar Customization
   ============================================ */
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
}

.sidebar-dark-primary .nav-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, .1);
}

.nav-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background-color: rgba(255, 255, 255, .1);
    color: #fff;
}

.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.brand-link .brand-image {
    margin-top: -3px;
}

.user-panel .info a {
    color: rgba(255, 255, 255, .8);
}

/* ============================================
   DataTables Beautification
   ============================================ */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
    outline: 0;
}

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.25rem;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--light-color) !important;
    border-color: #dee2e6 !important;
}

table.dataTable thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

table.dataTable tbody tr:hover {
    background-color: rgba(0, 123, 255, .05) !important;
}

/* ============================================
   Button Styling
   ============================================ */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Action buttons in tables */
.table td .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.125rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ============================================
   Form Styling
   ============================================ */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.required-field::after {
    content: " *";
    color: var(--danger-color);
}

/* Custom file input */
.custom-file-label::after {
    background-color: var(--primary-color);
    color: #fff;
}

/* Select2 customization */
.select2-container--bootstrap4 .select2-selection {
    border-radius: 0.375rem;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

/* ============================================
   Small Box / Stat Cards
   ============================================ */
.small-box {
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.small-box .icon {
    font-size: 70px;
    opacity: 0.3;
    position: absolute;
    right: 15px;
    top: 15px;
    transition: transform 0.3s ease;
}

.small-box:hover .icon {
    transform: scale(1.1);
}

.small-box .inner h3 {
    font-weight: 700;
    font-size: 2.2rem;
}

.small-box .small-box-footer {
    background-color: rgba(0, 0, 0, .1);
    transition: background-color 0.2s ease;
}

.small-box:hover .small-box-footer {
    background-color: rgba(0, 0, 0, .15);
}

/* ============================================
   Modal Styling
   ============================================ */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
}

.modal-header {
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-header.bg-danger {
    background-color: var(--danger-color) !important;
}

.modal-header.bg-danger .close {
    color: #fff;
    opacity: 0.8;
}

.modal-header.bg-danger .close:hover {
    opacity: 1;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* ============================================
   Navbar Customization
   ============================================ */
.main-header.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, .04);
}

.navbar-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 4px;
    position: absolute;
    right: 5px;
    top: 9px;
}

/* ============================================
   Content Header
   ============================================ */
.content-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* ============================================
   Footer
   ============================================ */
.main-footer {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    padding: 1rem;
}

/* ============================================
   Validation Styles
   ============================================ */
.is-invalid {
    border-color: var(--danger-color) !important;
}

.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, .25) !important;
}

.invalid-feedback,
.text-danger {
    color: var(--danger-color);
    font-size: 0.85rem;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ============================================
   Status Badges
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

.badge-pending,
.badge-warning {
    background-color: var(--warning-color);
    color: #212529;
}

.badge-approved,
.badge-success {
    background-color: var(--success-color);
    color: #fff;
}

.badge-rejected,
.badge-danger {
    background-color: var(--danger-color);
    color: #fff;
}

/* ============================================
   Image Handling
   ============================================ */
.img-circle {
    border-radius: 50%;
    object-fit: cover;
}

.img-thumbnail-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 0.5rem;
    object-fit: cover;
}

/* ============================================
   Export Button Container
   ============================================ */
.export-button-container {
    text-align: right;
    margin-bottom: 1rem;
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 768px) {
    .content-header h1 {
        font-size: 1.5rem;
    }

    .small-box .inner h3 {
        font-size: 1.8rem;
    }

    .card-tools {
        margin-top: 0.5rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .main-sidebar,
    .main-header,
    .main-footer,
    .card-tools,
    .btn {
        display: none !important;
    }

    .content-wrapper {
        margin-left: 0 !important;
    }
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
