/* Azaka Alert Predictions */

:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666;
    --border: #e0e0e0;
    --accent: #2563eb;
    --green: #16a34a;
    --yellow: #ca8a04;
    --red: #dc2626;
    --green-bg: #dcfce7;
    --yellow-bg: #fef9c3;
    --red-bg: #fee2e2;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0f0f;
        --surface: #1a1a1a;
        --text: #e5e5e5;
        --text-muted: #999;
        --border: #333;
        --green-bg: #14532d;
        --yellow-bg: #422006;
        --red-bg: #450a0a;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    letter-spacing: 0.1em;
}

.logo-icon {
    flex-shrink: 0;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    white-space: pre-line;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--border);
    border-radius: 6px;
    padding: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.lang-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Status */
.status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Main */
main {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

/* Event map */
.event-map {
    height: 250px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
    z-index: 0;
}

/* Filter */
.filter-bar { margin-bottom: 1rem; }

.filter-bar input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}

.filter-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Event cards */
.event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.625rem;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.event-header time {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent);
}

.city-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* Prediction badges */
.predictions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.low  { background: var(--green-bg);  color: var(--green); }
.badge.med  { background: var(--yellow-bg); color: var(--yellow); }
.badge.high { background: var(--red-bg);    color: var(--red); }

.no-pred {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Cities tags */
.cities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

[dir="rtl"] .cities { direction: rtl; }

.city {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.more {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.1rem 0.35rem;
}

.cities-toggle {
    cursor: pointer;
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

.cities-hidden {
    display: none;
}

.cities-hidden.expanded {
    display: contents;
}

/* States */
.loading, .empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

.author {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Mobile */
@media (max-width: 600px) {
    .header-top { gap: 0.5rem; }
    header h1 { font-size: 1.2rem; }
    main { padding: 0.75rem; }
    .event-card { padding: 0.75rem; }
    .badge { font-size: 0.7rem; padding: 0.1rem 0.4rem; }
}
