/* =====================================================
   GBV ANALYTICS PAGE - ENHANCED STYLES
   Version: 1.0
   Description: Modern styling for GBV Analytics Dashboard
   ===================================================== */

/* ===================================================== 
   0. CONTROL PANEL
   ===================================================== */
.gbv-control-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

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

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

.gbv-control-select:focus {
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgb(147 51 234 / 10%);
    outline: none;
}

.gbv-apply-btn {
    background: linear-gradient(135deg, #9333ea, #c084fc);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gbv-apply-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgb(147 51 234 / 30%);
    color: white;
}

/* ===================================================== 
   1. HERO SECTION
   ===================================================== */
.gbv-hero {
    background: linear-gradient(135deg, #9333ea 0%, #c084fc 25%, #e879f9 50%, #f0abfc 100%);
    padding: 5rem 0 6rem;
    margin: -1.5rem -15px 3rem;
    position: relative;
    overflow: hidden;
}

.gbv-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 120%;
    height: 200%;
    background: radial-gradient(circle at 80% 50%, rgb(236 72 153 / 20%) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgb(196 181 253 / 20%) 0%, transparent 50%);
    animation: float-slow 30s ease-in-out infinite;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ===================================================== 
   3. ANALYSIS TABS
   ===================================================== */
.gbv-tabs-container {
    margin: 3rem 0 2rem;
    background: white;
    border-radius: 20px;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgb(0 0 0 / 8%);
}

.gbv-tabs {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.gbv-tabs .nav-item {
    flex: 1;
}

.gbv-tabs .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gbv-tabs .nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #9333ea, #c084fc);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.gbv-tabs .nav-link:hover {
    color: #9333ea;
    background: rgb(147 51 234 / 5%);
}

.gbv-tabs .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #9333ea, #c084fc);
    box-shadow: 0 8px 20px rgb(147 51 234 / 30%);
}

.gbv-tabs .nav-link.active::before {
    opacity: 1;
}

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

.gbv-tabs .nav-link span {
    position: relative;
    z-index: 1;
}

/* ===================================================== 
   4. CHART CARDS
   ===================================================== */
.gbv-chart-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%);
    transition: all 0.3s ease;
    height: 100%;
}

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

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

.gbv-chart-header.primary { background: linear-gradient(135deg, #9333ea, #c084fc); }
.gbv-chart-header.info { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.gbv-chart-header.warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.gbv-chart-header.success { background: linear-gradient(135deg, #10b981, #34d399); }
.gbv-chart-header.danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.gbv-chart-header.secondary { background: linear-gradient(135deg, #64748b, #94a3b8); }

.gbv-chart-header.primary h5,
.gbv-chart-header.info h5,
.gbv-chart-header.warning h5,
.gbv-chart-header.success h5,
.gbv-chart-header.danger h5,
.gbv-chart-header.secondary h5 {
    color: white;
    text-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

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

.gbv-chart-body {
    padding: 2rem;
    background: rgb(248 250 252 / 50%);
}

.gbv-chart-container {
    position: relative;
    height: 300px;
}

/* ===================================================== 
   5. RISK PREDICTOR
   ===================================================== */
.risk-assessment-container {
    background: linear-gradient(135deg, #fef3c7 0%, #fee2e2 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.risk-score-display {
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 8%);
}

.risk-score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    transition: all 0.5s ease;
}

.risk-score-inner {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgb(0 0 0 / 10%);
}

#risk-score {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.risk-factor-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background-color: #f8f9fa;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.risk-factor-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
}

.risk-factor-card.risk-high {
    border-left-color: #dc2626;
    background: linear-gradient(to right, #fee2e2, #fef3c7);
}

.risk-factor-card.risk-medium {
    border-left-color: #f59e0b;
    background: linear-gradient(to right, #fef3c7, #fef9c3);
}

.risk-factor-card.risk-low {
    border-left-color: #10b981;
    background: linear-gradient(to right, #d1fae5, #dbeafe);
}

/* ===================================================== 
   6. SAFE COMMUNITIES
   ===================================================== */
.community-rank-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgb(147 51 234 / 10%);
    position: relative;
    overflow: hidden;
}

.community-rank-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgb(147 51 234 / 10%), transparent);
    transition: left 0.5s;
}

.community-rank-card:hover::before {
    left: 100%;
}

.community-rank-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 24px rgb(147 51 234 / 15%);
    border-color: #9333ea;
}

.community-rank {
    font-size: 1.5rem;
    font-weight: 900;
    color: #9333ea;
    margin-right: 0.5rem;
}

.community-rank.gold { color: #fbbf24; }
.community-rank.silver { color: #94a3b8; }
.community-rank.bronze { color: #f97316; }

.safety-score-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.25rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.safety-score-circle.high {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 4px 12px rgb(16 185 129 / 30%);
}

.safety-score-circle.medium {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 4px 12px rgb(245 158 11 / 30%);
}

.safety-score-circle.low {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 4px 12px rgb(220 38 38 / 30%);
}

/* ===================================================== 
   7. RESPONSE EFFECTIVENESS
   ===================================================== */
.response-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.response-table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgb(0 0 0 / 8%);
}

.response-table thead {
    background: linear-gradient(135deg, #9333ea, #c084fc);
}

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

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

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

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

.response-table tbody tr:hover {
    background: rgb(147 51 234 / 5%);
    transform: scale(1.01);
}

.effectiveness-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.effectiveness-progress {
    flex: 1;
    height: 10px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.effectiveness-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

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

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===================================================== 
   8. LOADING STATES
   ===================================================== */
.gbv-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}

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

/* ===================================================== 
   9. 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); }
}

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

@media (width <= 768px) {
    .gbv-hero {
        padding: 3rem 0 4rem;
    }
    
    .gbv-hero-title {
        font-size: 2.5rem;
    }
    
    .gbv-hero-subtitle {
        font-size: 1.125rem;
    }
    
    .gbv-metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gbv-metric-card {
        padding: 1.5rem;
    }
    
    .gbv-metric-value {
        font-size: 2.25rem;
    }
    
    .gbv-tabs {
        flex-direction: column;
    }
    
    .gbv-tabs .nav-link {
        justify-content: flex-start;
    }
    
    .gbv-chart-container {
        height: 250px;
    }
}

@media (width <= 480px) {
    .gbv-hero-title {
        font-size: 2rem;
    }
    
    .gbv-metric-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .gbv-metric-value {
        font-size: 1.75rem;
    }
    
    .risk-score-circle {
        width: 120px;
        height: 120px;
    }
    
    .risk-score-inner {
        width: 100px;
        height: 100px;
    }
    
    #risk-score {
        font-size: 2rem;
    }
}

/* ===================================================== 
   11. DARK MODE SUPPORT
   ===================================================== */












/* Enhanced Metric Cards */
.gbv-metric-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gbv-metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, currentcolor, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gbv-metric-card:hover::before {
    opacity: 0.5;
}

.gbv-metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgb(0 0 0 / 15%);
}

.metric-trend {
    margin-top: 8px;
    font-size: 0.85rem;
}

/* Insight Cards */
.insight-card {
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.insight-card:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #9333ea 0%, #c084fc 100%);
}

/* Export Button */
#export-report {
    border-color: #9333ea;
    color: #9333ea;
    transition: all 0.3s ease;
}

#export-report:hover {
    background: #9333ea;
    color: white;
    border-color: #9333ea;
}

/* Data updated time */
#data-updated-time {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border: none;
    border-radius: 8px;
}
