/* State Pages Styles */
/* CSS-Intel State Index and Detail Pages */

/* ============================================
   States Index Page - Hero
   ============================================ */
.states-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0c4a6e 100%);
    color: white;
    padding: 2rem 1.5rem 3rem;
    position: relative;
    overflow: hidden;
}

.states-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.states-hero-content {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.states-hero-header {
    text-align: center;
    margin-bottom: 2rem;
}

.states-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.states-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
}

/* National Stats */
.national-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.national-stat {
    text-align: center;
}

.national-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #0ea5e9;
}

.national-stat-label {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Search */
.states-search {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

.states-search svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: rgba(255, 255, 255, 0.5);
}

.states-search input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.states-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.states-search input:focus {
    outline: none;
    border-color: #0ea5e9;
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   States Grid
   ============================================ */
.states-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.state-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.state-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #0ea5e9;
}

.state-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.state-abbrev {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
}

.state-rank {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.state-card-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.state-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.state-card-stat {
    text-align: center;
}

.state-card-stat .stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.state-card-stat .stat-label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
}

.state-card-risk {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.state-card-risk .risk-label {
    color: #64748b;
}

.state-card-risk .risk-value {
    font-weight: 600;
    color: #0ea5e9;
}

.state-card-arrow {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s;
}

.state-card-arrow svg {
    width: 20px;
    height: 20px;
    fill: #0ea5e9;
}

.state-card:hover .state-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* No Results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.no-results svg {
    width: 48px;
    height: 48px;
    fill: #cbd5e1;
    margin-bottom: 1rem;
}

/* ============================================
   State Detail Page - Hero
   ============================================ */
.state-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0c4a6e 100%);
    color: white;
    padding: 2rem 1.5rem 3rem;
    position: relative;
    overflow: hidden;
}

.state-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.state-hero-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* Breadcrumb */
.state-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.state-breadcrumb a {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.state-breadcrumb a:hover {
    color: white;
}

.state-breadcrumb svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.state-breadcrumb .separator {
    color: rgba(255, 255, 255, 0.4);
}

.state-breadcrumb .current {
    color: white;
    font-weight: 500;
}

/* Hero Header */
.state-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.state-title-group {
    flex: 1;
    min-width: 280px;
}

.state-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(14, 165, 233, 0.2);
    border: 1px solid rgba(14, 165, 233, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 0.75rem;
}

.state-badge svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.state-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.state-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
}

/* Action Buttons */
.state-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.state-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.state-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.state-btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.state-btn-primary:hover {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.state-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.state-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Hero Stats */
.state-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.state-stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s;
}

.state-stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.state-stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(14, 165, 233, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.state-stat-icon svg {
    width: 22px;
    height: 22px;
    fill: #38bdf8;
}

.state-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.state-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ============================================
   State Content Sections
   ============================================ */
.state-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.state-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.section-header h2 svg {
    width: 24px;
    height: 24px;
    fill: #0ea5e9;
}

.section-header p {
    color: #64748b;
    font-size: 0.9375rem;
}

/* Hazards Grid */
.hazards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.hazard-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.hazard-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.hazard-risk {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.hazard-risk .risk-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0ea5e9;
}

.hazard-risk .risk-label {
    font-size: 0.75rem;
    color: #64748b;
}

.hazard-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.hazard-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #3b82f6);
    border-radius: 3px;
}

/* Disaster Breakdown */
.disaster-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.disaster-chart-container {
    height: 280px;
}

.disaster-types-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.disaster-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.dtype-info {
    display: flex;
    flex-direction: column;
}

.dtype-name {
    font-weight: 600;
    color: #1e293b;
}

.dtype-count {
    font-size: 0.8125rem;
    color: #64748b;
}

.dtype-cost {
    font-weight: 700;
    color: #0ea5e9;
    font-size: 1rem;
}

/* Decades Chart */
.decades-chart-container {
    height: 320px;
}

/* Counties Table */
.counties-table-container {
    overflow-x: auto;
}

.counties-table {
    width: 100%;
    border-collapse: collapse;
}

.counties-table th,
.counties-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.counties-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.counties-table tbody tr:hover {
    background: #f8fafc;
}

.rank-cell {
    font-weight: 700;
    color: #64748b;
    width: 60px;
}

.county-name {
    font-weight: 600;
    color: #1e293b;
}

.risk-score {
    font-weight: 600;
    color: #0ea5e9;
}

.rating-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rating-badge.rating-very-high {
    background: #fef2f2;
    color: #dc2626;
}

.rating-badge.rating-relatively-high {
    background: #fff7ed;
    color: #ea580c;
}

.rating-badge.rating-relatively-moderate {
    background: #fefce8;
    color: #ca8a04;
}

.rating-badge.rating-relatively-low {
    background: #f0fdf4;
    color: #16a34a;
}

.rating-badge.rating-very-low {
    background: #ecfdf5;
    color: #059669;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.event-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 10px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #0ea5e9;
}

.event-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0ea5e9;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.event-date {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.event-cost {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.event-deaths {
    font-size: 0.8125rem;
    color: #dc2626;
    margin-top: 0.25rem;
}

/* Earthquake Section */
.earthquake-section {
    border-left: 4px solid #ef4444;
}

.earthquake-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.earthquake-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.eq-stat {
    background: #fef2f2;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.eq-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #dc2626;
}

.eq-stat-label {
    display: block;
    font-size: 0.75rem;
    color: #991b1b;
    text-transform: uppercase;
}

.major-earthquakes h3,
.risk-factors h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.eq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.eq-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.875rem;
    background: #fff5f5;
    border-radius: 8px;
}

.eq-name {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.875rem;
}

.eq-details {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8125rem;
}

.eq-mag {
    font-weight: 600;
    color: #dc2626;
}

.eq-cost {
    color: #64748b;
}

.risk-factors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.risk-factors li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #475569;
    font-size: 0.9375rem;
}

.risk-factors li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.875rem;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* CTA Section */
.state-cta {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    color: white;
}

.state-cta h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.state-cta p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.cta-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.cta-btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.cta-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .states-title,
    .state-title {
        font-size: 1.75rem;
    }
    
    .states-subtitle,
    .state-subtitle {
        font-size: 1rem;
    }
    
    .national-stats {
        gap: 1.5rem;
    }
    
    .national-stat-value {
        font-size: 1.5rem;
    }
    
    .state-hero-header {
        flex-direction: column;
    }
    
    .state-actions {
        width: 100%;
    }
    
    .state-btn {
        flex: 1;
        justify-content: center;
    }
    
    .state-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .disaster-breakdown {
        grid-template-columns: 1fr;
    }
    
    .disaster-chart-container {
        height: 220px;
    }
    
    .section-header h2 {
        font-size: 1.125rem;
    }
    
    .hazards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .counties-table th,
    .counties-table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .state-cta {
        padding: 2rem 1.5rem;
    }
    
    .state-cta h2 {
        font-size: 1.375rem;
    }
}

@media (max-width: 480px) {
    .states-hero,
    .state-hero {
        padding: 1.5rem 1rem 2rem;
    }
    
    .state-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .state-stat-value {
        font-size: 1.375rem;
    }
    
    .hazards-grid {
        grid-template-columns: 1fr;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .earthquake-content {
        grid-template-columns: 1fr;
    }
    
    .cta-actions {
        flex-direction: column;
    }
    
    .cta-btn {
        width: 100%;
        justify-content: center;
    }
}
