/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
}

/* Navigation Styles */
.navbar-brand {
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-weight: 500;
}

.navbar-nav .nav-link.active {
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 600;
}

/* Table Styles */
.table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

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

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    border-radius: 4px;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #343a40; /* Ensure form labels are visible in light mode */
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
    font-weight: 500;
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* List Group Styles */
.list-group-item {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-left: none;
    border-right: none;
    transition: background-color 0.2s;
}

.list-group-item:first-child {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.list-group-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.list-group-item:hover {
    background-color: rgba(13, 110, 253, 0.03);
}

/* Dashboard Specific Styles */
.display-6 {
    font-size: 1.8rem;
    font-weight: 300;
}

.stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
}

.stat-card .card-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-card .card-text {
    margin-bottom: 0;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Quick Actions Styles */
.quick-actions .btn {
    padding: 1rem 0.5rem;
    text-align: center;
}

.quick-actions .btn i {
    display: block;
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background-color: rgba(0, 0, 0, 0.02);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: rgba(0, 0, 0, 0.02);
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin: 1rem 0;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    margin: 0 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #0d6efd;
    color: white !important;
    border: 1px solid #0d6efd;
}

/* Login Page Styles */
.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-header {
    background: #2c3e50;
    color: white;
    padding: 25px;
    text-align: center;
}

.login-body {
    padding: 25px;
}

.user-type-selector {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 20px;
}

.user-type-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-type-btn.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.floating-label {
    position: relative;
    margin-bottom: 20px;
}

.floating-label label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    background: white;
    padding: 0 5px;
    color: #777;
    transition: all 0.3s;
    pointer-events: none;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.8rem;
    color: #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-6 {
        font-size: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem 0.5rem;
    }
    
    .quick-actions .btn {
        padding: 0.75rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .quick-actions .btn i {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .chart-container {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Custom Utilities */
.text-small {
    font-size: 0.875rem;
}

.text-smaller {
    font-size: 0.75rem;
}

.border-light {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.bg-light-gradient {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Print Styles */
@media print {
    .navbar, .btn, .quick-actions, .modal {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .table-responsive {
        overflow: visible;
    }
}

/* Dark mode support (fixed for form labels) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #212529;
        color: #f8f9fa;
    }
    
    .card {
        background-color: #2d3035;
        color: #f8f9fa;
    }
    
    .table {
        color: #f8f9fa;
    }
    
    .table th {
        background-color: #2d3035;
        color: #f8f9fa;
    }
    
    .form-control, .form-select {
        background-color: #2d3035;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    /* Fix for form labels in dark mode */
    .form-label,
    .form-check-label,
    .floating-label label,
    .form-text {
        color: #f8f9fa !important;
    }
    
    .floating-label label {
        background-color: #2d3035 !important;
    }
    
    .form-control:focus, .form-select:focus {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
        background-color: #2d3035;
        color: #f8f9fa;
    }
    
    /* Modal dark mode fixes */
    .modal-content {
        background-color: #2d3035;
        color: #f8f9fa;
    }
    
    .modal-header, .modal-footer {
        background-color: rgba(255, 255, 255, 0.05) !important;
        border-color: #495057 !important;
    }
    
    /* Alert dark mode fixes */
    .alert-info {
        background-color: rgba(13, 202, 240, 0.2);
        border-color: rgba(13, 202, 240, 0.3);
        color: #9ce6f9;
    }
    
    /* Login page specific dark mode fixes */
    .login-container {
        background: #2d3035;
        color: #f8f9fa;
    }
    
    .user-type-selector {
        background: #343a40;
    }
    
    .user-type-btn.active {
        background: #495057;
        color: #f8f9fa;
    }
    
    .floating-label input:focus + label,
    .floating-label input:not(:placeholder-shown) + label {
        color: #86b7fe !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Prevent modal caching */
.modal.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.modal.fade.show {
    opacity: 1;
}