/* ─── Tokens ─── */
:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --surface-3: #eef1f5;
    --border: rgba(0, 0, 0, 0.07);
    --border-focus: rgba(99, 102, 241, 0.4);

    --accent: #6366f1;
    --accent-light: #4f46e5;
    --accent-dim: rgba(99, 102, 241, 0.08);
    --green: #16a34a;
    --green-dim: rgba(34, 197, 94, 0.08);
    --amber: #d97706;
    --red: #dc2626;
    --cyan: #0891b2;

    --text-1: #1e293b;
    --text-2: #475569;
    --text-3: #94a3b8;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-1);
    min-height: 100vh;
    padding: 1.25rem;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ─── Glass Panel ─── */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ─── Header ─── */
header {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border-top: 2px solid var(--accent);
}

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

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    padding: 0.65rem;
    border-radius: var(--radius-sm);
}

.titles h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
}

.titles p {
    color: var(--text-3);
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ─── Buttons ─── */
.premium-btn {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: white;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.premium-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.premium-btn:active {
    transform: translateY(0);
}

.premium-btn:disabled {
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.premium-btn::after {
    display: none;
}

/* ─── Status Badge ─── */
.status-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--surface-3);
    color: var(--text-3);
    border: 1px solid var(--border);
}

.status-badge.active {
    background: var(--green-dim);
    color: var(--green);
    border-color: rgba(34, 197, 94, 0.2);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.active .pulse-dot {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5)
    }

    70% {
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0)
    }
}

/* ─── Progress ─── */
.progress-area {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.progress-bar-container {
    height: 3px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    width: 30%;
    background: var(--accent);
    border-radius: 2px;
    animation: indeterminate 2s infinite linear;
    transform-origin: 0% 50%;
}

@keyframes indeterminate {
    0% {
        transform: translateX(0) scaleX(0)
    }

    40% {
        transform: translateX(0) scaleX(0.4)
    }

    100% {
        transform: translateX(100%) scaleX(0.5)
    }
}

.progress-text {
    color: var(--text-3);
    font-size: 0.75rem;
    text-align: center;
}

/* ─── View Toggles ─── */
.view-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.2s ease;
}

.view-toggle-btn i {
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: var(--radius-xs);
    background: var(--surface-3);
    color: var(--text-3);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.view-toggle-btn .toggle-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-1);
}

.view-toggle-btn .toggle-sub {
    display: block;
    font-size: 0.68rem;
    color: var(--text-3);
    margin-top: 0.05rem;
}

.view-toggle-btn:hover {
    border-color: var(--accent);
}

.view-toggle-btn:hover i {
    color: var(--accent-light);
}

.active-toggle {
    border-color: var(--accent) !important;
    background: var(--accent-dim) !important;
}

.active-toggle i {
    background: var(--accent) !important;
    color: white !important;
}

.active-toggle .toggle-label {
    color: var(--accent-light) !important;
}

/* ─── Empty / Stats ─── */
.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--text-3);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h2 {
    color: var(--text-2);
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 1rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card i {
    font-size: 1.4rem;
    color: white;
    background: linear-gradient(135deg, var(--green), #15803d);
    padding: 0.65rem;
    border-radius: var(--radius-sm);
}

.stat-details h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.05rem;
}

.stat-details span {
    color: var(--text-3);
    font-size: 0.72rem;
}

/* ─── Results Grid ─── */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ─── City Card ─── */
.city-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.city-header {
    background: var(--surface-2);
    padding: 0.7rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.city-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-1);
}

.city-title i {
    color: var(--amber);
    font-size: 0.85rem;
}

/* ─── Source Badge ─── */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.source-badge.csb {
    background: rgba(6, 182, 212, 0.12);
    color: var(--cyan);
}

.source-badge.milli {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
}

.source-badge.ilan {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
}

/* ─── Announcement Item ─── */
.announcement-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.announcement-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* -- Header -- */
.ann-header {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.ann-source-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.announcement-title {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-2);
    margin-bottom: 0.4rem;
}

.announcement-meta {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    color: var(--text-3);
    font-size: 0.72rem;
}

.announcement-meta span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.announcement-meta a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
}

.announcement-meta a:hover {
    text-decoration: underline;
}

/* ── Location Hero Strip ── */
.location-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.loc-chip {
    flex: 1;
    min-width: 100px;
    padding: 0.6rem 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.03));
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.loc-chip .lc-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-light);
}

.loc-chip .lc-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-1);
}

.loc-chip.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.08));
}

.loc-chip.primary .lc-value {
    color: var(--accent-light);
    font-size: 1.05rem;
}

/* -- Metrics Row -- */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    border-bottom: 1px solid var(--border);
}

.metric-item {
    padding: 0.6rem 0.85rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.metric-item:last-child {
    border-right: none;
}

.metric-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
}

.metric-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-1);
}

/* -- Tech Grid -- */
.tech-section {
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.4rem;
}

.tech-item {
    background: var(--surface-3);
    border-radius: var(--radius-xs);
    padding: 0.45rem 0.6rem;
}

.tech-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    margin-bottom: 0.1rem;
}

.tech-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    overflow-wrap: break-word;
}

/* -- Notes -- */
.notes-section {
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.note-item {
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.35rem;
    background: var(--surface-3);
    border-radius: var(--radius-xs);
    border-left: 2px solid var(--border);
}

.note-item:last-child {
    margin-bottom: 0;
}

.note-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    margin-bottom: 0.15rem;
}

.note-value {
    font-size: 0.76rem;
    font-weight: 400;
    color: var(--text-3);
    line-height: 1.5;
    white-space: pre-line;
}

/* -- Attachments -- */
.attachments-section {
    padding: 0.75rem 1.1rem;
}

.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.attachment-link:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-dim);
}

.attachment-link i {
    font-size: 0.8rem;
    color: var(--red);
}

.no-attachments {
    font-size: 0.72rem;
    color: var(--text-3);
}

/* ─── Helpers ─── */
.hidden {
    display: none !important;
}