/* Reports Dashboard Styles */

/* Loading, Error, and Empty States */
.loading-state, .error-state, .empty-state {
    text-align: center;
    padding: 60px 20px;
    margin: 40px 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #005A9C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error-state {
    color: #dc3545;
}

.error-state i {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-state {
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #dee2e6;
}

/* Report Cards */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.report-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.report-card--low {
    border-left: 4px solid #ffc107; /* Yellow */
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
}

.report-card--medium {
    border-left: 4px solid #fd7e14; /* Orange */
    background: linear-gradient(135deg, rgba(253, 126, 20, 0.1), rgba(253, 126, 20, 0.05));
}

.report-card--high {
    border-left: 4px solid rgba(220, 53, 69, 0.7); /* Red with reduced opacity */
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
}

/* Make the header/banner of each report card match the urgency color.
   This targets the header inside a specific report card so it overrides
   the global .report-header (modal) styles without changing the modal.
*/
.report-card--low .report-header {
    background: linear-gradient(90deg, rgba(255,193,7,0.12), rgba(255,193,7,0.06));
    color: rgba(74, 44, 0, 0.95);
    border-radius: 8px 8px 0 0;
    padding: 16px 20px;
}

.report-card--medium .report-header {
    background: linear-gradient(90deg, rgba(253,126,20,0.12), rgba(253,126,20,0.06));
    color: rgba(95, 45, 0, 0.95);
    border-radius: 8px 8px 0 0;
    padding: 16px 20px;
}

.report-card--high .report-header {
    background: linear-gradient(90deg, rgba(220,53,69,0.12), rgba(220,53,69,0.06));
    color: rgba(80, 10, 10, 0.95);
    border-radius: 8px 8px 0 0;
    padding: 16px 20px;
}

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

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.report-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
    line-height: 1.3;
    flex: 1;
}

.report-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #6c757d;
}

.meta-item i {
    width: 16px;
    color: #005A9C;
}

.report-description {
    margin-bottom: 20px;
}

.report-description p {
    margin: 0;
    color: #495057;
    line-height: 1.5;
    font-size: 0.95em;
}

.report-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.btn-view {
    background: #005A9C;
    color: white;
}

.btn-view:hover {
    background: #004a80;
}

.btn-verify {
    background: #28a745;
    color: white;
}

.btn-verify:hover {
    background: #1e7e34;
}

.btn-assign {
    background: #17a2b8;
    color: white;
}

.btn-assign:hover {
    background: #117a8b;
}

.btn-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge--pending {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.5);
}

.status-badge--active {
    background: rgba(0, 123, 255, 0.2);
    color: #004085;
    border: 1px solid rgba(0, 123, 255, 0.5);
}

.status-badge--resolved {
    background: rgba(40, 167, 69, 0.2);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.5);
}

.status-badge--closed {
    background: rgba(108, 117, 125, 0.2);
    color: #383d41;
    border: 1px solid rgba(108, 117, 125, 0.5);
}

/* Utility Classes */
.text-danger {
    color: rgba(220, 53, 69, 0.8) !important; /* Reduced opacity red */
    font-weight: 600;
}

.text-warning {
    color: #ffc107 !important;
    font-weight: 600;
}

.text-success {
    color: #28a745 !important;
    font-weight: 600;
}

/* Page Title */
#page-title {
    text-align: center;
    margin: 30px 0;
    color: #2c3e50;
    font-size: 2em;
    font-weight: 600;
}

/* Filters Section */
.filters-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.9em;
    font-weight: 600;
    color: #495057;
}

.filter-group input,
.filter-group select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.9em;
    background: white;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #005A9C;
    box-shadow: 0 0 0 2px rgba(0, 90, 156, 0.25);
}

.btn-clear {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.btn-clear:hover {
    background: #545b62;
}

/* Statistics Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.stats-info {
    font-size: 1.1em;
    font-weight: 500;
}

.stats-actions {
    display: flex;
    gap: 10px;
}

.btn-refresh {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}

.pagination button {
    padding: 10px 20px;
    background: #005A9C;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    background: #004a80;
}

.pagination button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.page-info {
    font-weight: 600;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .report-actions {
        justify-content: center;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .report-card {
        padding: 15px;
    }
    
    .report-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-action {
        font-size: 0.8em;
        padding: 6px 10px;
    }
}

/* Role-based Header Styling */
.role-badge {
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

/* Header Gradients */
.admin-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.authority-header {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
}

.rescue-team-header {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}