/* CSS Variables & Palette */
:root {
    --cyber-slate: #0f172a;
    --cyber-glass: rgba(255, 255, 255, 0.85);
    --sismik-blue: #1e3c72;
    --sismik-light: #2a5298;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-light: rgba(0, 0, 0, 0.05);
}

/* Base Utility Overrides */
.content-wrapper-premium {
    padding: 1.5rem;
}

/* Interactive Card Styling */
.modern-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    border-color: rgba(30, 60, 114, 0.15);
}
.card-header-modern {
    padding: 20px 24px;
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Premium Gradient Banner */
.premium-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e3c72 100%);
    border-radius: 24px;
    padding: 30px 40px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
}
.premium-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
}
.premium-banner-badge {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.7rem;
}

/* Stats Metric Widget */
.stat-widget {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 22px 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.01);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}
.stat-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.04);
}
.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}
.stat-widget:hover .stat-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.bg-soft-red { background: rgba(239, 68, 68, 0.08); color: #ef4444; }
.bg-soft-green { background: rgba(16, 185, 129, 0.08); color: #10b981; }
.bg-soft-yellow { background: rgba(245, 158, 11, 0.08); color: #f59e0b; }
.bg-soft-blue { background: rgba(59, 130, 246, 0.08); color: #3b82f6; }

.stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: #0f172a;
    margin: 12px 0 2px 0;
    line-height: 1.1;
}
.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-uppercase: true;
    letter-spacing: 0.5px;
}
.stat-subtext {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Upgraded Form Controls */
.modern-input {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px 16px;
    color: #334155;
    font-weight: 500;
    transition: all 0.2s ease;
}
.modern-input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    color: #0f172a;
}
.modern-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-uppercase: true;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: inline-block;
}

/* Modernized Buttons */
.btn-modern-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: none;
    border-radius: 12px;
    padding: 13px 24px;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.25);
    transition: all 0.25s ease;
}
.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.35);
    background: linear-gradient(135deg, #234785 0%, #3463b3 100%);
}
.btn-modern-primary:active {
    transform: translateY(0);
}

.btn-modern-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    padding: 11px 20px;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: all 0.2s ease;
}
.btn-modern-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Image Gallery Card Grid */
.gallery-card {
    border-radius: 18px;
    border: 1px solid var(--border-light);
    background: #ffffff;
    padding: 14px;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.01);
}
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.06);
}
.gallery-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid rgba(0,0,0,0.03);
}
.gallery-image {
    width: 100%;
    height: 170px;
    object-fit: contain;
    transition: all 0.4s ease;
}
.gallery-card:hover .gallery-image {
    transform: scale(1.04);
}
.gallery-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.gallery-image-wrapper:hover .gallery-overlay {
    opacity: 1;
}
.gallery-btn {
    width: 42px;
    height: 42px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    text-decoration: none;
}
.gallery-btn:hover {
    transform: scale(1.1);
    background: #1e3c72;
    color: white;
}

/* Bespoke Tables */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}
.custom-table thead th {
    background: #f8fafc;
    border: none;
    color: #475569;
    font-weight: 700;
    font-size: 0.72rem;
    text-uppercase: true;
    letter-spacing: 0.5px;
    padding: 14px 20px;
}
.custom-table tbody tr {
    background: #ffffff;
    transition: all 0.2s ease;
}
.custom-table tbody tr:hover {
    background: #f8fafc;
}
.custom-table tbody td {
    padding: 14px 20px;
    border-top: 1px solid rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.03);
    color: #334155;
    font-size: 0.82rem;
    font-weight: 500;
}
.custom-table tbody td:first-child {
    border-left: 1px solid rgba(0,0,0,0.03);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.custom-table tbody td:last-child {
    border-right: 1px solid rgba(0,0,0,0.03);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Real-Time Cyber Seismology Console */
.terminal-modal-header {
    background: #090d16 !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    padding: 18px 24px !important;
}
.terminal-console {
    background: #05070c !important;
    border-radius: 0 0 16px 16px !important;
    padding: 24px !important;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace !important;
    font-size: 0.8rem !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8) !important;
    color: #e2e8f0;
}
.terminal-console::-webkit-scrollbar-track { background: #05070c; }
.terminal-console::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }

/* Pulse Indicator */
.pulse-active {
    display: inline-block;
    width: 9px;
    height: 9px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: active-pulse 1.8s infinite;
}
@keyframes active-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Custom styles for Leaflet */
#analysisMap {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.map-card-wrapper {
    position: relative;
}

#log-container::-webkit-scrollbar { width: 6px; }
#log-container::-webkit-scrollbar-track { background: #05070c; }
#log-container::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
.log-line { padding: 3px 0 3px 12px; border-left: 2.5px solid rgba(255,255,255,0.06); margin-bottom: 3px; font-size: 0.8rem; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.log-line.type-info { color: #58a6ff; border-left-color: #58a6ff; }
.log-line.type-success { color: #56d364; border-left-color: #56d364; }
.log-line.type-error { color: #ff7b72; border-left-color: #ff7b72; }
.log-line.type-warning { color: #e3b341; border-left-color: #e3b341; }
.log-line.type-debug { color: #8b949e; border-left-color: #30363d; }

/* Dark Theme Overrides */
[data-theme="dark"] .stat-widget { background: #1e293b !important; border-color: rgba(255, 255, 255, 0.08) !important; }
[data-theme="dark"] .stat-value { color: #f8fafc !important; }
[data-theme="dark"] .stat-label { color: #94a3b8 !important; }
[data-theme="dark"] .stat-subtext { color: #64748b !important; }
[data-theme="dark"] .stat-subtext span { color: #cbd5e1 !important; }
[data-theme="dark"] .modern-card { background: #0f172a !important; border-color: rgba(255, 255, 255, 0.08) !important; color: #f8fafc !important; }
[data-theme="dark"] .card-header-modern { border-bottom-color: rgba(255, 255, 255, 0.08) !important; }
[data-theme="dark"] .card-header-modern h6 { color: #f8fafc !important; }
[data-theme="dark"] .gallery-card { background: #1e293b !important; border-color: rgba(255, 255, 255, 0.08) !important; }
[data-theme="dark"] .gallery-card span { color: #f1f5f9 !important; }
[data-theme="dark"] .gallery-image-wrapper { background: #0f172a !important; border-color: rgba(255, 255, 255, 0.05) !important; }
[data-theme="dark"] .modern-input { background: #1e293b !important; border-color: #334155 !important; color: #f8fafc !important; }
[data-theme="dark"] .modern-label { color: #cbd5e1 !important; }
