/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --error-color: #dc2626;
    --success-color: #16a34a;
    --warning-color: #ea580c;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
}

header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header h1 a:hover {
    opacity: 0.9;
}

.tagline {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: 70vh;
}

/* Search Section */
.search-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.search-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.search-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--surface);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-hint {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.results-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Statistics Section */
.stats-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.stats-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 300;
}

.top-crimes, .victim-demographics, .years-breakdown {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.top-crimes h3, .victim-demographics h3, .years-breakdown h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.top-crimes ul, .victim-demographics ul, .years-breakdown ul {
    list-style: none;
}

.top-crimes li, .victim-demographics li, .years-breakdown li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-crimes li:last-child, .victim-demographics li:last-child, .years-breakdown li:last-child {
    border-bottom: none;
}

/* Crime Records */
.records-section {
    margin: 2rem 0;
}

.records-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-note {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.records-list {
    display: grid;
    gap: 1.5rem;
}

.crime-record {
    background: var(--surface);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    border-left: 4px solid var(--primary-color);
}

.crime-record:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(3px);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crime-type {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    flex: 1;
    min-width: 200px;
}

.record-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.record-body p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.record-body strong {
    color: var(--text-secondary);
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

.record-id {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Quick Links */
.quick-links {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.quick-links h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.link-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: block;
}

.link-card:hover {
    border-color: var(--primary-color);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.link-card-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.link-card-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Breadcrumb */
.breadcrumb {
    margin: 1rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Page Description */
.page-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 1rem 0 2rem;
    line-height: 1.7;
}

/* Buttons */
.button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.back-to-search {
    text-align: center;
    margin: 3rem 0;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .search-section {
        padding: 1.5rem;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .record-header {
        flex-direction: column;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    .search-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .search-box input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    .crime-record {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    header, footer, .search-section, .back-to-search, .quick-links {
        display: none;
    }
    
    .crime-record {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
}

