/* Enhanced styles for Tigray Knowledge Base */

/* Hero sections and landing page enhancements */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 8px;
    margin: 2rem 0;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-section .subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lighter);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--md-primary-fg-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--md-default-fg-color--light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content grid layouts */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--md-primary-fg-color);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.feature-card h3 {
    margin-top: 0;
    color: var(--md-primary-fg-color);
}

/* Chart containers */
.chart-container {
    background: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    overflow: hidden;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--md-default-fg-color);
}

/* Data table enhancements */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--md-default-bg-color);
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.data-table th {
    background: var(--md-code-bg-color);
    font-weight: 600;
    color: var(--md-default-fg-color);
}

.data-table tr:hover {
    background: var(--md-code-bg-color);
}

/* Memorial and sensitive content styling */
.memorial-section {
    border-left: 4px solid #dc3545;
    padding-left: 1.5rem;
    margin: 2rem 0;
    background: rgba(220, 53, 69, 0.05);
    border-radius: 0 8px 8px 0;
}

.memorial-section h3 {
    color: #dc3545;
    margin-top: 0;
}

.victim-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.victim-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.victim-details {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Timeline styles */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--md-primary-fg-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--md-primary-fg-color);
}

.timeline-date {
    font-weight: 600;
    color: var(--md-primary-fg-color);
    font-size: 0.9rem;
}

/* Progress indicators */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--md-default-fg-color--lightest);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.5s ease;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-operational { background: #d4edda; color: #155724; }
.status-limited { background: #fff3cd; color: #856404; }
.status-disrupted { background: #f8d7da; color: #721c24; }
.status-unknown { background: #e2e3e5; color: #383d41; }

/* Download and button enhancements */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.download-card {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 8px;
    padding: 1.5rem;
    background: var(--md-default-bg-color);
    transition: all 0.3s ease;
}

.download-card:hover {
    border-color: var(--md-primary-fg-color);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
}

/* Map and geographic content */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
    border: 1px solid var(--md-default-fg-color--lightest);
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        padding: 0.75rem;
    }
}

/* Dark mode adjustments */
[data-md-color-scheme="slate"] .hero-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-md-color-scheme="slate"] .stat-card,
[data-md-color-scheme="slate"] .feature-card,
[data-md-color-scheme="slate"] .download-card {
    background: var(--md-code-bg-color);
    border-color: var(--md-default-fg-color--lighter);
}

[data-md-color-scheme="slate"] .victim-card {
    background: var(--md-code-bg-color);
    border-color: var(--md-default-fg-color--lighter);
}

/* Print styles */
@media print {
    .hero-section {
        background: none !important;
        color: black !important;
        border: 1px solid #ccc;
    }
    
    .stat-card,
    .feature-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
    
    .chart-container {
        break-inside: avoid;
    }
}

/* Accessibility improvements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--md-primary-fg-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Focus indicators */
.feature-card:focus-within,
.stat-card:focus-within,
.download-card:focus-within {
    outline: 2px solid var(--md-primary-fg-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-section {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .stat-card,
    .feature-card {
        border: 2px solid var(--md-default-fg-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .feature-card,
    .download-card {
        transition: none;
    }
    
    .progress-fill {
        transition: none;
    }
}

/* Interactive Charts */
.chart-container {
    margin: 2rem 0;
    border: 1px solid var(--md-default-fg-color--lighter);
    border-radius: 8px;
    background: var(--md-default-bg-color);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-header {
    padding: 1rem 1.5rem;
    background: var(--md-primary-fg-color--light);
    border-bottom: 1px solid var(--md-default-fg-color--lighter);
}

.chart-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--md-default-fg-color);
}

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

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--md-default-fg-color--light);
    font-size: 1rem;
}

.chart-loading:before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--md-default-fg-color--lighter);
    border-top: 2px solid var(--md-primary-fg-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--md-typeset-color);
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin: 1rem;
    padding: 1rem;
    text-align: center;
}

.chart-actions {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--md-default-fg-color--lighter);
    background: var(--md-code-bg-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.chart-download-btn {
    background: var(--md-primary-fg-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.chart-download-btn:hover {
    background: var(--md-primary-fg-color--dark);
}

.chart-download-btn:disabled {
    background: var(--md-default-fg-color--lighter);
    cursor: not-allowed;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chart responsiveness */
@media (max-width: 768px) {
    .chart-container {
        margin: 1rem 0;
    }
    
    .chart-header {
        padding: 0.75rem 1rem;
    }
    
    .chart-title {
        font-size: 1rem;
    }
    
    .chart-actions {
        padding: 0.5rem 1rem;
    }
    
    .chart-download-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Contribute section styling */
.contribute-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 3rem 2rem;
    border-radius: 16px;
    margin: 3rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.contribute-section h2 {
    text-align: center;
    color: #ff6b35;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.contribute-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.contribute-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.contribute-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255,107,53,0.2);
    border-color: #ff6b35;
}

.contribute-icon {
    font-size: 3rem;
    color: #ff6b35;
    margin-bottom: 1rem;
}

.contribute-card h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.contribute-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.contribute-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35 0%, #e55722 100%);
    color: white !important;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255,107,53,0.3);
}

.contribute-btn:hover {
    background: linear-gradient(135deg, #e55722 0%, #d84315 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,107,53,0.4);
    color: white !important;
}

.update-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255,107,53,0.1);
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.update-item {
    color: #333;
    font-size: 0.95rem;
}

.update-item strong {
    color: #ff6b35;
    font-weight: 600;
}

/* Responsive design for contribute section */
@media (max-width: 768px) {
    .contribute-section {
        padding: 2rem 1rem;
        margin: 2rem 0;
    }
    
    .contribute-section h2 {
        font-size: 2rem;
    }
    
    .contribute-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contribute-card {
        padding: 1.5rem;
    }
    
    .update-info {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}
