/* Crime Statistics Page - Custom Styles */

.crime-statistics-page {
    padding-bottom: 60px;
}

/* Loading Skeleton Animations */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.2s ease-in-out infinite;
}

.skeleton-text {
    height: 1.2em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-number {
    height: 2rem;
    width: 80%;
    margin: 0 auto 8px;
    border-radius: 4px;
}

.skeleton-label {
    height: 0.9rem;
    width: 60%;
    margin: 0 auto;
    border-radius: 4px;
}

/* Crime Navigation - matches profile-nav pattern */
.crime-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    margin-bottom: var(--space-xl, 2rem);
    flex-wrap: wrap;
    gap: var(--space-md, 1rem);
}

/* Data Period Info */
.data-period {
    font-size: 0.95rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Card Header Styling - Override for crime page */
.crime-statistics-page .card-header {
    background: linear-gradient(135deg, #533483, #6b4494);
    color: white;
    text-align: center;
    padding: 1.5rem;
    display: block;
}

.crime-statistics-page .card-header h3 {
    color: white;
    margin: 0 0 0.75rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.4;
    flex-wrap: wrap;
}

.crime-statistics-page .card-header i {
    color: white;
    opacity: 0.95;
}

/* Card Subtitle Styling */
.card-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 300;
    text-align: center;
    line-height: 1.5;
    display: block;
}

/* Date Range Info in card headers */
.date-range-info {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Stats Summary Grid */
.stats-summary {
    display: grid;
    grid-template-columns: 2fr 0.3fr 1fr 1fr 1fr 1fr;
    gap: 20px;
    margin: 0 auto;
    align-items: center;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card.stat-equals {
    background: transparent;
    box-shadow: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-symbol {
    font-size: 3rem;
    font-weight: 700;
    color: #533483;
    opacity: 0.7;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #533483;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Data Note Styling */
.data-note {
    background: #fff3cd;
    padding: 15px;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    margin-top: 20px;
    color: #856404;
}

/* Analysis Container */
.analysis-container {
    padding: 0 24px;
    margin-bottom: 0;
}

.analysis-container .alert-info {
    margin-bottom: 0;
    font-style: italic;
}

.analysis-container .alert-info i {
    flex-shrink: 0;
}

.analysis-container .alert-info span {
    line-height: 1.6;
}

/* Chart Containers - Now inside card-content */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

.chart-container.half {
    height: 350px;
}

.chart-container.large {
    height: 500px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-box {
    position: relative;
    height: 400px;
}

.crime-statistics-page .chart-box h3 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    color: #533483 !important;
    font-weight: 600;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    background: transparent;
}

.chart-box canvas {
    max-height: calc(100% - 50px) !important;
    width: 100% !important;
}

canvas {
    max-height: 100%;
}

/* Data Tables - Now inside card-content */
.data-table-wrapper {
    border-radius: 8px;
    overflow: hidden;
    margin-top: 30px;
    border: 1px solid #e9ecef;
}

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

.crime-table thead {
    background: #533483;
    color: white;
}

.crime-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.crime-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.crime-table tbody tr:hover {
    background: #f8f9fa;
}

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

/* Insights Grid */
.insights-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.insight-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
    transition: all 0.3s ease;
}

.insight-card:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.insight-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.insight-card h3,
.insight-card h4 {
    font-size: 1rem;
    color: #533483;
    margin-bottom: 10px;
    font-weight: 600;
    text-align: center;
}

.insight-value,
.insight-label {
    font-size: 1.5rem;
    color: #533483;
    font-weight: 700;
    margin-bottom: 5px;
}

.insight-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 400;
    margin-top: 10px;
}

.insight-detail {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
}


/* Responsive Design */
@media (max-width: 768px) {
    .stats-summary {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card.stat-equals {
        display: none;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container,
    .chart-container.half,
    .chart-container.large {
        height: 300px;
    }

    .crime-table {
        font-size: 0.85rem;
    }

    .crime-table th,
    .crime-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .stats-summary {
        grid-template-columns: 1fr;
    }

    .insight-icon {
        font-size: 2rem;
    }

    .insight-value {
        font-size: 1.2rem;
    }

    .chart-box h3 {
        font-size: 1rem;
    }
}
