/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 10px;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 300;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== INFO BOX ===== */
.info-box {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.info-box h2 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #2c3e50;
}

.info-box p {
    margin: 0;
    line-height: 1.6;
}

.info-box a {
    color: #2980b9;
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

/* ===== STATS SECTION ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 20px;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.stat-card.active {
    background: #495057;
    color: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    transform: translateY(1px);
}

.stat-card.active .stat-number,
.stat-card.active .stat-label {
    color: white;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ===== CONTROLS SECTION ===== */
.controls {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 300px;
}

input[type="text"],
input[type="search"],
select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

input[type="text"],
input[type="search"] {
    width: 100%;
    padding-right: 2.5rem;
}

select {
    background: white;
    cursor: pointer;
}

.clear-search {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
}

.clear-search.visible {
    display: flex;
}

/* ===== FILTER MESSAGES ===== */
#siteCount {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
}

#filterMessage {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

#filterMessage a {
    color: #3498db;
    text-decoration: none;
    cursor: pointer;
}

#filterMessage a:hover {
    text-decoration: underline;
}

/* ===== BADGES ===== */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #ecf0f1;
    color: #555;
}

.badge.active {
    background: #2ecc71;
    color: white;
}

.badge.inactive {
    background: #e74c3c;
    color: white;
}

.badge.bluesky {
    background: #00A8E8;
    color: white;
}

.badge.local {
    background: #9b59b6;
    color: white;
}

/* ===== UTILITY CLASSES ===== */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #7f8c8d;
}

.error {
    background: #fee;
    color: #c00;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .info-box {
        padding: 0.5rem 0.75rem;
    }

    .info-box h2 {
        font-size: 0.9rem;
    }

    .info-box p {
        font-size: 0.85rem;
    }

    .stats {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 0.4rem;
    }

    .stat-card {
        padding: 0.4rem 0.25rem;
    }

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

    .stat-label {
        font-size: 0.65rem;
        line-height: 1.1;
        min-height: 2.2em;
    }

    .controls {
        padding: 0.75rem;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .search-wrapper {
        min-width: 0;
    }

    #filterSelect {
        display: none;
    }

    select {
        flex: 1;
    }

    #siteCount,
    #filterMessage {
        display: none;
    }
}
