/* ═══════════════════════════════════════════════════════════════════
   EARTHQUAKE MONITOR v4 - Editorial Design
   Clean • Professional • Trustworthy
   ═══════════════════════════════════════════════════════════════════ */

.eq-monitor {
    --eq-bg: #ffffff;
    --eq-surface: #f8fafc;
    --eq-border: #e2e8f0;
    --eq-border-strong: #cbd5e1;

    --eq-text: #1e293b;
    --eq-text-secondary: #64748b;
    --eq-text-muted: #94a3b8;

    --eq-accent: #0f172a;
    --eq-red: #dc2626;
    --eq-orange: #ea580c;
    --eq-amber: #d97706;
    --eq-emerald: #059669;

    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);

    font-family: var(--font-sans);
    background: var(--eq-bg);
    color: var(--eq-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ═══════════════════════════════════════════════════════════════════
   HEADER - Authoritative & Clean
   ═══════════════════════════════════════════════════════════════════ */

.eq-header {
    background: var(--eq-accent) !important;
    color: #ffffff !important;
    padding: 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 768px) {
    .eq-header {
        padding: 24px 20px;
        flex-direction: column;
        align-items: flex-start;
    }
}

.eq-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.eq-logo {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.eq-logo svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.eq-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 0;
    color: #ffffff !important;
}

.eq-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.7) !important;
    margin-top: 4px;
    font-weight: 400;
}

.eq-live-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffffff !important;
}

.eq-live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════ */

.eq-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 40px;
}

@media (max-width: 768px) {
    .eq-main {
        padding: 24px 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   STATS ROW - Clean Data Display
   ═══════════════════════════════════════════════════════════════════ */

.eq-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .eq-stats {
        grid-template-columns: 1fr;
    }
}

.eq-stat {
    background: var(--eq-surface);
    border: 1px solid var(--eq-border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

.eq-stat-value {
    font-family: var(--font-serif);
    font-size: 42px;
    font-weight: 600;
    color: var(--eq-text);
    line-height: 1;
    letter-spacing: -1px;
}

.eq-stat-value.eq-highlight {
    color: var(--eq-red);
}

.eq-stat-label {
    font-size: 13px;
    color: var(--eq-text-secondary);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════
   FILTERS - Minimal & Functional
   ═══════════════════════════════════════════════════════════════════ */

.eq-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.eq-filter-group {
    display: flex;
    background: var(--eq-surface);
    border: 1px solid var(--eq-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.eq-filter-btn {
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--eq-text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border-right: 1px solid var(--eq-border);
}

.eq-filter-btn:last-child {
    border-right: none;
}

.eq-filter-btn:hover {
    background: var(--eq-border);
    color: var(--eq-text);
}

.eq-filter-btn.active {
    background: var(--eq-accent);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════
   GRID LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

.eq-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

@media (max-width: 1024px) {
    .eq-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   MAP - Clean & Professional
   ═══════════════════════════════════════════════════════════════════ */

.eq-map-container {
    background: var(--eq-bg);
    border: 1px solid var(--eq-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.eq-map-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--eq-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--eq-surface);
}

.eq-map-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--eq-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.eq-map-title svg {
    width: 18px;
    height: 18px;
    fill: var(--eq-red);
}

.eq-map-meta {
    font-size: 12px;
    color: var(--eq-text-muted);
}

#eq-map {
    height: 480px;
    background: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════════════════
   MAP MARKERS - Clean Circles
   ═══════════════════════════════════════════════════════════════════ */

.eq-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 11px;
    color: white;
    border: 2px solid white;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.eq-marker:hover {
    transform: scale(1.15);
}

.eq-marker.recent {
    animation: marker-pulse 2s ease-in-out infinite;
}

@keyframes marker-pulse {
    0%, 100% { box-shadow: var(--shadow-md), 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: var(--shadow-md), 0 0 0 8px rgba(220, 38, 38, 0); }
}

/* ═══════════════════════════════════════════════════════════════════
   EARTHQUAKE LIST - Editorial Cards
   ═══════════════════════════════════════════════════════════════════ */

.eq-list-container {
    background: var(--eq-bg);
    border: 1px solid var(--eq-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: 560px;
}

.eq-list-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--eq-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--eq-surface);
    flex-shrink: 0;
}

.eq-list-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--eq-text);
}

.eq-count-badge {
    background: var(--eq-accent);
    color: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

.eq-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.eq-list::-webkit-scrollbar {
    width: 6px;
}

.eq-list::-webkit-scrollbar-track {
    background: var(--eq-surface);
}

.eq-list::-webkit-scrollbar-thumb {
    background: var(--eq-border-strong);
    border-radius: 3px;
}

/* ═══════════════════════════════════════════════════════════════════
   EARTHQUAKE CARD - Clean & Scannable
   ═══════════════════════════════════════════════════════════════════ */

.eq-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--eq-border);
    position: relative;
}

.eq-card:last-child {
    border-bottom: none;
}

.eq-card:hover {
    background: var(--eq-surface);
}

.eq-card.eq-is-new::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--eq-red);
    border-radius: 0 2px 2px 0;
}

/* Magnitude Badge */
.eq-mag-badge {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.eq-mag-badge.eq-low {
    background: var(--eq-emerald);
}

.eq-mag-badge.eq-moderate {
    background: var(--eq-amber);
}

.eq-mag-badge.eq-high {
    background: var(--eq-orange);
}

.eq-mag-badge.eq-severe {
    background: var(--eq-red);
}

/* Card Content */
.eq-card-content {
    flex: 1;
    min-width: 0;
}

.eq-location {
    font-size: 14px;
    font-weight: 600;
    color: var(--eq-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eq-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--eq-text-secondary);
}

.eq-detail {
    display: flex;
    align-items: center;
    gap: 4px;
}

.eq-detail svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.6;
}

/* Time Badge */
.eq-time-badge {
    font-size: 12px;
    color: var(--eq-text-muted);
    text-align: right;
    flex-shrink: 0;
}

.eq-time-badge.eq-just-now {
    color: var(--eq-red);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   SAFETY SECTION - Institutional Feel
   ═══════════════════════════════════════════════════════════════════ */

.eq-safety {
    margin-top: 32px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.eq-safety-header {
    background: #fef3c7;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #fde68a;
}

.eq-safety-header svg {
    width: 22px;
    height: 22px;
    fill: #b45309;
}

.eq-safety-header h3 {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
}

.eq-tips {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.eq-tip {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.eq-tip-num {
    width: 28px;
    height: 28px;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.eq-tip-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #78350f;
    margin-bottom: 2px;
}

.eq-tip-content p {
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER ATTRIBUTION
   ═══════════════════════════════════════════════════════════════════ */

.eq-footer {
    margin-top: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--eq-border);
    text-align: center;
    font-size: 12px;
    color: var(--eq-text-muted);
}

.eq-footer a {
    color: var(--eq-text-secondary);
    text-decoration: none;
}

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

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════ */

.eq-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--eq-text-muted);
}

.eq-empty svg {
    width: 48px;
    height: 48px;
    fill: var(--eq-border-strong);
    margin-bottom: 12px;
}

.eq-empty p {
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   RTL SUPPORT
   ═══════════════════════════════════════════════════════════════════ */

[dir="rtl"] .eq-card.eq-is-new::before {
    left: auto;
    right: 0;
    border-radius: 2px 0 0 2px;
}

[dir="rtl"] .eq-filter-btn {
    border-right: none;
    border-left: 1px solid var(--eq-border);
}

[dir="rtl"] .eq-filter-btn:last-child {
    border-left: none;
}

/* ═══════════════════════════════════════════════════════════════════
   LEAFLET POPUP OVERRIDE
   ═══════════════════════════════════════════════════════════════════ */

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 16px;
    font-family: var(--font-sans);
}

.leaflet-popup-tip {
    box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════════════════════
   COMPREHENSIVE RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .eq-grid {
        grid-template-columns: 1fr;
    }

    .eq-list-container {
        max-height: none;
    }

    #eq-map {
        height: 400px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .eq-header {
        padding: 20px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .eq-header-left {
        gap: 14px;
    }

    .eq-logo {
        width: 42px;
        height: 42px;
    }

    .eq-logo svg {
        width: 24px;
        height: 24px;
    }

    .eq-title {
        font-size: 22px !important;
    }

    .eq-subtitle {
        font-size: 13px !important;
    }

    .eq-live-indicator {
        padding: 8px 14px;
        font-size: 11px;
    }

    .eq-main {
        padding: 20px 12px;
    }

    .eq-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .eq-stat {
        padding: 18px;
    }

    .eq-stat-value {
        font-size: 32px;
    }

    .eq-stat-label {
        font-size: 11px;
    }

    .eq-filters {
        flex-direction: column;
        gap: 10px;
    }

    .eq-filter-group {
        width: 100%;
        display: flex;
    }

    .eq-filter-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 12px;
        text-align: center;
    }

    #eq-map {
        height: 320px;
    }

    .eq-map-header,
    .eq-list-header {
        padding: 12px 14px;
    }

    .eq-map-title,
    .eq-list-title {
        font-size: 14px;
    }

    .eq-list {
        padding: 6px;
    }

    .eq-card {
        padding: 12px;
        gap: 12px;
    }

    .eq-mag-badge {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }

    .eq-location {
        font-size: 13px;
    }

    .eq-details {
        font-size: 12px;
        gap: 10px;
    }

    .eq-time-badge {
        font-size: 11px;
    }

    .eq-safety-header {
        padding: 14px 16px;
    }

    .eq-safety-header h3 {
        font-size: 14px;
    }

    .eq-tips {
        padding: 16px;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .eq-tip {
        gap: 10px;
    }

    .eq-tip-num {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .eq-tip-content h4 {
        font-size: 13px;
    }

    .eq-tip-content p {
        font-size: 12px;
    }

    .eq-footer {
        font-size: 11px;
        padding: 14px 0;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .eq-header {
        padding: 16px 12px;
    }

    .eq-title {
        font-size: 18px !important;
    }

    .eq-subtitle {
        font-size: 12px !important;
    }

    .eq-stat-value {
        font-size: 28px;
    }

    .eq-filter-btn {
        padding: 8px 6px;
        font-size: 11px;
    }

    #eq-map {
        height: 280px;
    }

    .eq-mag-badge {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .eq-card {
        padding: 10px;
        gap: 10px;
    }
}
