/* =====================================================
   INCIDENTS PAGE - ENHANCED STYLES (GBV Analytics Inspired)
   Version: 1.0
   Description: Modern styling for Incidents Dashboard
   ===================================================== */

/* ===================================================== 
   1. HERO SECTION
   ===================================================== */
.incidents-hero {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 25%, #f87171 50%, #fca5a5 100%);
    padding: 5rem 0 6rem;
    margin: -1.5rem -15px 3rem;
    position: relative;
    overflow: hidden;
}

.incidents-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 120%;
    height: 200%;
    background: radial-gradient(circle at 80% 50%, rgb(248 113 113 / 20%) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgb(252 165 165 / 20%) 0%, transparent 50%);
    animation: float-slow 30s ease-in-out infinite;
}

.incidents-hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 120px;
    background: #f8fafc;
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0% 100%);
}

.incidents-hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.incidents-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(10px);
    border: 1px solid rgb(255 255 255 / 30%);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: white;
    font-weight: 600;
}

.incidents-hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.incidents-hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgb(0 0 0 / 10%);
    animation: slideInUp 0.8s ease-out;
}

.incidents-hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
    animation: slideInUp 0.8s ease-out 0.2s backwards;
}

/* ===================================================== 
   2. KEY METRICS CARDS
   ===================================================== */
.incidents-metrics-container {
    margin-top: -80px;
    position: relative;
    z-index: 10;
    padding: 0 1rem;
}

.incidents-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.incidents-metric-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 15px 40px rgb(0 0 0 / 10%);
    border: 1px solid rgb(0 0 0 / 5%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.incidents-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, currentcolor, transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.incidents-metric-card:hover::before {
    transform: translateX(100%);
}

.incidents-metric-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgb(0 0 0 / 15%);
}

.incidents-metric-card.danger {
    --metric-color: #dc2626;
    color: var(--metric-color);
}

.incidents-metric-card.warning {
    --metric-color: #f59e0b;
    color: var(--metric-color);
}

.incidents-metric-card.info {
    --metric-color: #3b82f6;
    color: var(--metric-color);
}

.incidents-metric-card.success {
    --metric-color: #10b981;
    color: var(--metric-color);
}

.incidents-metric-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--metric-color), color-mix(in srgb, var(--metric-color), white 30%));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 25px color-mix(in srgb, var(--metric-color), transparent 60%);
    position: relative;
    overflow: hidden;
}

.incidents-metric-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgb(255 255 255 / 40%) 50%, transparent 70%);
    animation: shine 3s infinite;
}

.incidents-metric-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.incidents-metric-value {
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--metric-color), color-mix(in srgb, var(--metric-color), black 20%));
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.incidents-metric-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* ===================================================== 
   3. FILTERS SECTION
   ===================================================== */
.incidents-filters-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    margin-bottom: 2rem;
    border: 1px solid rgb(0 0 0 / 5%);
}

.incidents-filters-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.incidents-filters-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgb(220 38 38 / 25%);
}

.incidents-filters-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    display: block;
}

.form-select,
.form-control {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-select:focus,
.form-control:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgb(220 38 38 / 10%);
    outline: none;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range-inputs .form-control {
    flex: 1;
}

.date-range-separator {
    color: #94a3b8;
    font-weight: 600;
}

/* Enhanced checkboxes for factors and impact filters */
.factor-checkboxes-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem 0;
}

.form-check-inline {
    margin-right: 0;
}

.impact-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-check {
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-check:hover {
    background: rgb(220 38 38 / 5%);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgb(220 38 38 / 30%);
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: #475569;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.form-check:hover .form-check-label {
    color: #1e293b;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-filter {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter-primary {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    border: none;
}

.btn-filter-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgb(220 38 38 / 30%);
}

.btn-filter-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e5e7eb;
}

.btn-filter-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-filter-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    border: none;
    margin-left: auto;
}

.btn-filter-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgb(16 185 129 / 30%);
}

/* ===================================================== 
   4. INCIDENTS TABLE
   ===================================================== */
.incidents-table-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
    overflow: hidden;
    border: 1px solid rgb(0 0 0 / 5%);
}

.incidents-table-header {
    background: linear-gradient(to bottom, rgb(249 250 251 / 80%), transparent);
    padding: 1.75rem;
    border-bottom: 1px solid rgb(0 0 0 / 5%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.incidents-table-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.incidents-count-badge {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-reload {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    color: #64748b;
    transition: all 0.3s ease;
}

.btn-reload:hover {
    background: #f8fafc;
    border-color: #dc2626;
    color: #dc2626;
    transform: rotate(180deg);
}

.incidents-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.incidents-table thead {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.incidents-table thead th {
    color: white;
    font-weight: 700;
    padding: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    border: none;
}

.incidents-table thead th:first-child {
    border-top-left-radius: 0;
}

.incidents-table thead th:last-child {
    border-top-right-radius: 0;
}

.incidents-table tbody td {
    padding: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.incidents-table tbody tr {
    transition: all 0.3s ease;
}

.incidents-table tbody tr:hover {
    background: rgb(220 38 38 / 5%);
    transform: scale(1.01);
}

.incidents-table tbody tr:last-child td {
    border-bottom: none;
}

/* Impact Badges */
.impact-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.impact-badge.deaths {
    background: rgb(220 38 38 / 10%);
    color: #dc2626;
}

.impact-badge.injuries {
    background: rgb(245 158 11 / 10%);
    color: #f59e0b;
}

.impact-badge.property {
    background: rgb(59 130 246 / 10%);
    color: #3b82f6;
}

.impact-badge.none {
    background: rgb(100 116 139 / 10%);
    color: #64748b;
}

/* Status Badges */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.submitted {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.status-badge.verified {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.status-badge.pending {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.status-badge.rejected {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

/* Action Buttons */
.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.btn-action-view {
    background: rgb(59 130 246 / 10%);
    color: #3b82f6;
    border: 1px solid rgb(59 130 246 / 20%);
}

.btn-action-view:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(59 130 246 / 30%);
}

.btn-action-edit {
    background: rgb(245 158 11 / 10%);
    color: #f59e0b;
    border: 1px solid rgb(245 158 11 / 20%);
}

.btn-action-edit:hover {
    background: #f59e0b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(245 158 11 / 30%);
}

/* ===================================================== 
   5. PAGINATION
   ===================================================== */
.incidents-pagination {
    padding: 1.5rem;
    background: rgb(248 250 252 / 50%);
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: #64748b;
    font-size: 0.875rem;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.pagination {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    background: white;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    text-decoration: none;
}

.page-link:hover {
    background: #f8fafc;
    border-color: #dc2626;
    color: #dc2626;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border-color: transparent;
    color: white;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================================================== 
   6. LOADING STATES
   ===================================================== */
.incidents-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: #64748b;
}

.incidents-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e7eb;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

/* ===================================================== 
   7. ANIMATIONS
   ===================================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================================== 
   8. RESPONSIVE DESIGN
   ===================================================== */
@media (width <= 1200px) {
    .incidents-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (width <= 768px) {
    .incidents-hero {
        padding: 3rem 0 4rem;
    }
    
    .incidents-hero-title {
        font-size: 2.5rem;
    }
    
    .incidents-hero-subtitle {
        font-size: 1.125rem;
    }
    
    .incidents-metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .incidents-metric-card {
        padding: 1.5rem;
    }
    
    .incidents-metric-value {
        font-size: 2.25rem;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .btn-filter-success {
        margin-left: 0;
        width: 100%;
    }
    
    .incidents-table {
        font-size: 0.875rem;
    }
    
    .incidents-table thead th,
    .incidents-table tbody td {
        padding: 0.75rem;
    }
    
    .incidents-pagination {
        flex-direction: column;
    }
}

@media (width <= 480px) {
    .incidents-hero-title {
        font-size: 2rem;
    }
    
    .incidents-metric-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .incidents-metric-value {
        font-size: 1.75rem;
    }
    
    .date-range-inputs {
        flex-direction: column;
    }
    
    .date-range-separator {
        display: none;
    }
}

/* ===================================================== 
   9. DARK MODE SUPPORT
   ===================================================== */








