/* =====================================================
   COMMUNITY RESPONSE PAGE - ENHANCED STYLES
   Version: 1.0
   Description: Modern styling for Community Response Dashboard
   ===================================================== */

/* ===================================================== 
   CHART CONTAINERS - HEIGHT CONSTRAINTS
   ===================================================== */
#effectiveness-chart,
#trends-chart,
#response-type-chart,
#response-hour-chart,
#comparative-chart {
    max-height: 300px !important;
    height: 300px !important;
}

.chart-container {
    position: relative;
    height: 300px;
    max-height: 300px;
    width: 100%;
    overflow: hidden;
}

canvas {
    max-height: 300px !important;
    width: 100% !important;
}

/* Additional specific controls for different chart types */
#trends-chart {
    height: 250px !important;
    max-height: 250px !important;
}

/* Ensure no chart grows beyond container */
.tab-pane canvas {
    display: block;
    box-sizing: border-box;
}

/* ===================================================== 
   1. HERO SECTION
   ===================================================== */
.community-hero {
    background: linear-gradient(135deg, #10b981 0%, #34d399 25%, #6ee7b7 50%, #a7f3d0 100%);
    padding: 5rem 0 6rem;
    margin: -1.5rem -15px 3rem;
    position: relative;
    overflow: hidden;
}

.community-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 120%;
    height: 200%;
    background: radial-gradient(circle at 80% 50%, rgb(110 231 183 / 20%) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgb(167 243 208 / 20%) 0%, transparent 50%);
    animation: float-slow 30s ease-in-out infinite;
}

.community-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%);
}

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

.community-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;
}

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

.community-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;
}

.community-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
   ===================================================== */
.community-metrics-container {
    margin-top: -80px;
    position: relative;
    z-index: 10;
    padding: 0 1rem;
}

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

.community-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;
}

.community-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;
}

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

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

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

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

.community-metric-card.primary {
    --metric-color: #6366f1;
    color: var(--metric-color);
}

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

.community-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;
}

.community-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;
}

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

.community-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;
}

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

/* ===================================================== 
   3. ENHANCED CARDS
   ===================================================== */
.community-card-enhanced {
    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%);
    transition: all 0.3s ease;
}

.community-card-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgb(0 0 0 / 12%);
}

.community-card-enhanced .card-header {
    background: linear-gradient(to bottom, rgb(249 250 251 / 80%), transparent);
    border-bottom: 1px solid rgb(0 0 0 / 5%);
    padding: 1rem;
}

.community-card-enhanced.border-primary .card-header {
    background: linear-gradient(135deg, #6366f1, #818cf8);
}

/* ===================================================== 
   4. NAVIGATION TABS
   ===================================================== */
.nav-pills {
    background: #f3f4f6;
    padding: 0.5rem;
    border-radius: 16px;
    display: flex;
    gap: 0.5rem;
}

.nav-pills .nav-link {
    background: transparent;
    color: #64748b;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-pills .nav-link:hover {
    background: rgb(16 185 129 / 10%);
    color: #10b981;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 8px 20px rgb(16 185 129 / 30%);
}

.nav-pills .nav-link i {
    font-size: 1.125rem;
}

/* ===================================================== 
   5. ENHANCED TABLES
   ===================================================== */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background: linear-gradient(135deg, #10b981, #34d399);
}

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

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

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

.table tbody tr:hover {
    background: rgb(16 185 129 / 5%);
    transform: scale(1.01);
}

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

/* ===================================================== 
   6. PROGRESS BARS
   ===================================================== */
.progress {
    height: 1.5rem;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgb(0 0 0 / 6%);
}

.progress-bar {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-primary));
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 30%), transparent);
    animation: shimmer 2s infinite;
}

.progress-bar.bg-success {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.progress-bar.bg-info {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.progress-bar.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.progress-bar.bg-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
}

/* ===================================================== 
   7. LIST GROUPS
   ===================================================== */
.list-group {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
}

.list-group-item {
    border: none;
    border-bottom: 1px solid #f3f4f6;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background: rgb(16 185 129 / 5%);
    transform: translateX(4px);
}

/* ===================================================== 
   8. CHARTS
   ===================================================== */
canvas {
    border-radius: 12px;
    background: rgb(248 250 252 / 50%);
    padding: 1rem;
}

/* ===================================================== 
   9. MAP STYLES
   ===================================================== */
#capacity-map {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 10%);
    overflow: hidden;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
}

.leaflet-popup-content {
    margin: 1rem;
    font-size: 0.875rem;
}

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

.badge.bg-success {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
}

/* ===================================================== 
   11. ALERTS
   ===================================================== */
.alert-info {
    background: linear-gradient(135deg, rgb(59 130 246 / 10%), rgb(96 165 250 / 5%));
    border: 1px solid rgb(59 130 246 / 20%);
    border-radius: 16px;
    padding: 1.5rem;
}

.alert-info h6 {
    color: #3b82f6;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ===================================================== 
   12. ACTION CARDS
   ===================================================== */
.card {
    border-radius: 16px;
    border: 1px solid rgb(0 0 0 / 5%);
    box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.card-text {
    color: #64748b;
    line-height: 1.6;
}

/* ===================================================== 
   13. LOADING STATES
   ===================================================== */
.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25rem;
}

.spinner-border.spinner-border-sm {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2rem;
}

/* ===================================================== 
   14. FORM CONTROLS
   ===================================================== */
.form-select {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgb(16 185 129 / 10%);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

/* ===================================================== 
   15. 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 shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

@media (width <= 768px) {
    .community-hero {
        padding: 3rem 0 4rem;
    }
    
    .community-hero-title {
        font-size: 2.5rem;
    }
    
    .community-hero-subtitle {
        font-size: 1.125rem;
    }
    
    .community-metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .community-metric-card {
        padding: 1.5rem;
    }
    
    .community-metric-value {
        font-size: 2.25rem;
    }
    
    .nav-pills {
        flex-wrap: wrap;
    }
    
    .nav-pills .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem;
    }
}

@media (width <= 480px) {
    .community-hero-title {
        font-size: 2rem;
    }
    
    .community-metric-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .community-metric-value {
        font-size: 1.75rem;
    }
    
    #capacity-map {
        height: 350px !important;
    }
}

/* ===================================================== 
   17. DARK MODE SUPPORT
   ===================================================== */















