/* Taiwan Village Population Statistics Platform - Main CSS */

.custom-header {
    background: linear-gradient(135deg, #003078 0%, #1d70b8 100%);
    color: white;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.custom-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><defs><pattern id='grid' width='10' height='10' patternUnits='userSpaceOnUse'><path d='M 10 0 L 0 0 0 10' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1'/></pattern></defs><rect width='100' height='100' fill='url(%23grid)'/></svg>");
    opacity: 0.3;
}

.custom-header h1 {
    color: white;
    margin: 0;
    position: relative;
    z-index: 2;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.custom-header p {
    position: relative;
    z-index: 2;
    opacity: 0.95;
}

.stats-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #1d70b8, #003078);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d70b8;
    margin: 0;
}

.stats-label {
    font-size: 1.125rem;
    color: #505a5f;
    margin: 0.5rem 0 0 0;
}

.growth-indicator {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.growth-positive {
    background: #d4edda;
    color: #155724;
}

.growth-negative {
    background: #f8d7da;
    color: #721c24;
}

.growth-neutral {
    background: #e2e3e5;
    color: #383d41;
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 2rem 0;
}

.map-container {
    position: relative;
    height: 400px;
    margin: 2rem 0;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-container .leaflet-container {
    height: 100%;
    width: 100%;
}

.main-content-area {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    min-height: 60vh;
    padding: 2rem 0;
}

.footer-custom {
    background: linear-gradient(135deg, #0b0c0c 0%, #1a1a1a 100%);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 3rem;
}

.year-selector {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.year-buttons, #year-buttons, .month-buttons, #month-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.year-button, .month-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 2px solid #1d70b8;
    background: white;
    color: #1d70b8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    min-width: 3rem;
}

.year-button:hover, .year-button.active, .month-button:hover, .month-button.active {
    background: #1d70b8;
    color: white;
    text-decoration: none;
}

.ranking-card {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border-left: 4px solid #d73527;
}

.ranking-card .stats-number {
    color: #d73527;
}

.ranking-card .stats-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.ranking-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    background: #e9ecef;
    color: #495057;
}

.ranking-top10 {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    box-shadow: 0 2px 4px rgba(255, 140, 0, 0.3);
}

.ranking-top100 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a9a9a9 100%);
    color: #000;
}

.ranking-row:hover {
    background-color: #f8f9fa;
}

.search-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.cunli-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: white;
}

.cunli-item {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cunli-item:hover {
    background-color: #f8f9fa;
}

.cunli-item:last-child {
    border-bottom: none;
}

.cunli-name {
    font-weight: 600;
    color: #1d70b8;
}

.cunli-location {
    color: #505a5f;
    font-size: 0.875rem;
}

.stats-summary {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.county-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1rem;
}

.county-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}