@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

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

body {
    font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
    background: #e8e8e8;
    color: #333;
    font-size: 13px;
    min-height: 100vh;
}

/* Navigation Bar */
.nav-bar {
    background: linear-gradient(to bottom, #5a5a5a, #3a3a3a);
    border-bottom: 1px solid #222;
    padding: 0 12px;
    display: flex;
    align-items: center;
    height: 34px;
    gap: 2px;
}

.nav-btn {
    background: linear-gradient(to bottom, #6a6a6a, #4a4a4a);
    color: #e0e0e0;
    border: 1px solid #555;
    border-bottom: none;
    padding: 5px 16px;
    font-size: 12px;
    font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
    cursor: pointer;
    border-radius: 3px 3px 0 0;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
    position: relative;
    top: 1px;
    transition: background 0.15s;
}

.nav-btn:hover {
    background: linear-gradient(to bottom, #7a7a7a, #5a5a5a);
}

.nav-btn.active {
    background: linear-gradient(to bottom, #8a8a8a, #6a6a6a);
    color: #fff;
}

.nav-spacer {
    flex: 1;
}

.nav-btn.login {
    background: linear-gradient(to bottom, #555, #3a3a3a);
    border: 1px solid #444;
    border-radius: 3px;
    top: 0;
}

/* Header Banner */
.header-banner {
    background: linear-gradient(to bottom, #6b7b8d, #4a5a6b, #3d4d5e);
    padding: 28px 20px;
    text-align: center;
    border-bottom: 2px solid #2d3d4e;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.header-banner h1 {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.header-banner p {
    color: #c8d4e0;
    font-size: 14px;
    font-weight: 300;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Main Layout */
.main-content {
    display: flex;
    gap: 16px;
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    width: 340px;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Panels */
.panel {
    background: #fff;
    border: 1px solid #ccc;
    border-left: 3px solid #4a6a8a;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.panel-header {
    background: linear-gradient(to bottom, #f8f8f8, #eaeaea);
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    font-size: 14px;
    color: #2a3a4a;
}

.panel-body {
    padding: 12px;
}

/* Form Elements */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.form-row label {
    width: 110px;
    font-size: 12px;
    color: #444;
    font-weight: 600;
    flex-shrink: 0;
}

.form-row input[type="text"],
.form-row select {
    flex: 1;
    padding: 4px 6px;
    border: 1px solid #aaa;
    border-radius: 2px;
    font-size: 12px;
    font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.form-row input[type="text"]:focus,
.form-row select:focus {
    outline: none;
    border-color: #4a6a8a;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 0 3px rgba(74,106,138,0.3);
}

.helper-text {
    font-size: 10px;
    color: #888;
    margin-left: 118px;
    margin-top: -6px;
    margin-bottom: 8px;
}

.error-text {
    font-size: 10px;
    color: #c00;
    margin-left: 118px;
    margin-top: -6px;
    margin-bottom: 8px;
}

.mmi-preview-row {
    display: flex;
    align-items: center;
    margin-left: 118px;
    margin-bottom: 10px;
    margin-top: -4px;
    padding: 6px 8px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 3px;
    font-size: 11px;
}

/* Buttons */
.btn-create {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: linear-gradient(to bottom, #5cb85c, #449d44);
    color: #fff;
    border: 1px solid #398439;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    margin-top: 6px;
    transition: background 0.15s;
}

.btn-create:hover {
    background: linear-gradient(to bottom, #4cae4c, #3a8c3a);
}

.btn-create:active {
    background: linear-gradient(to bottom, #3a8c3a, #2d7a2d);
    box-shadow: inset 0 2px 3px rgba(0,0,0,0.2);
}

.btn-clear {
    padding: 4px 14px;
    background: linear-gradient(to bottom, #d9534f, #c9302c);
    color: #fff;
    border: 1px solid #ac2925;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: background 0.15s;
}

.btn-clear:hover {
    background: linear-gradient(to bottom, #c9302c, #b52a26);
}

.btn-back {
    padding: 6px 20px;
    background: linear-gradient(to bottom, #5cb85c, #449d44);
    color: #fff;
    border: 1px solid #398439;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-back:hover {
    background: linear-gradient(to bottom, #4cae4c, #3a8c3a);
}

.btn-share {
    padding: 8px 24px;
    background: linear-gradient(to bottom, #5cb85c, #449d44);
    color: #fff;
    border: 1px solid #398439;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    width: 100%;
    transition: background 0.15s;
}

.btn-share:hover {
    background: linear-gradient(to bottom, #4cae4c, #3a8c3a);
}

/* Map Container */
.map-area {
    flex: 1;
    min-width: 0;
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, #f8f8f8, #eaeaea);
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    border-left: 3px solid #4a6a8a;
}

.map-header h3 {
    font-size: 14px;
    color: #2a3a4a;
    font-weight: 600;
}

#map {
    width: 100%;
    height: 620px;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 3px 3px;
    z-index: 1;
}

.map-container-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 3px 3px;
}

/* Recent Earthquakes */
.recent-list {
    max-height: 400px;
    overflow-y: auto;
}

.recent-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-size: 11px;
    line-height: 1.5;
}

.recent-item.clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.recent-item.clickable:hover {
    background: #f0f4f8;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item .mag {
    font-weight: bold;
    color: #c00;
}

.recent-empty {
    text-align: center;
    padding: 20px 10px;
    color: #999;
    font-size: 12px;
    border: 1px dashed #ddd;
    border-radius: 3px;
    line-height: 1.6;
}

/* Wave Legend */
.wave-legend {
    position: absolute;
    bottom: 30px;
    left: 10px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #999;
    border-radius: 3px;
    padding: 8px 12px;
    font-size: 11px;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.wave-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

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

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
}

.legend-dot.p-wave {
    background: transparent;
    border-color: #1e64dc;
}

.legend-dot.s-wave {
    background: transparent;
    border-color: #dc2828;
}

/* Detail Page */
.detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 20px;
}

.detail-header-banner {
    background: linear-gradient(to bottom, #5a6a7a, #3d4d5e);
    padding: 16px 20px;
    border-bottom: 2px solid #2d3d4e;
}

.detail-header-banner h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.detail-header-banner p {
    color: #b0c0d0;
    font-size: 12px;
    font-weight: 300;
}

.detail-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #ccc;
    border-left: 3px solid #4a6a8a;
    padding: 10px 16px;
    margin: 16px 16px 0;
    border-radius: 3px;
}

.detail-title-text {
    font-size: 16px;
    font-weight: 700;
    color: #2a3a4a;
}

.detail-main-row {
    display: flex;
    gap: 16px;
    padding: 16px;
}

.detail-info-col {
    width: 420px;
    min-width: 360px;
    flex-shrink: 0;
}

.detail-map-col {
    flex: 1;
    min-width: 0;
}

.detail-summary-card {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 3px solid #4a6a8a;
    border-radius: 3px;
    padding: 14px;
    margin-bottom: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-grid-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 10px 12px;
}

.detail-grid-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 3px;
    font-weight: 500;
}

.detail-grid-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    font-family: 'IBM Plex Mono', monospace;
}

.detail-feel-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 12px;
}

/* Felt Reports Section */
.felt-reports-section {
    margin: 0 16px;
}

.felt-reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, #f8f8f8, #eaeaea);
    border: 1px solid #ccc;
    border-left: 3px solid #4a6a8a;
    border-bottom: none;
    padding: 10px 16px;
    border-radius: 3px 3px 0 0;
}

.felt-reports-list {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 3px 3px;
    max-height: 600px;
    overflow-y: auto;
}

.felt-report-card {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    border-left: 3px solid #ddd;
    transition: background 0.15s;
}

.felt-report-card:hover {
    background: #fafafa;
}

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

.felt-report-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

/* Event Overview Section */
.event-overview-section {
    margin: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-left: 3px solid #4a6a8a;
    border-radius: 3px;
    padding: 16px;
}

/* Earthquake List Page */
.eq-list-page {
    max-width: 1200px;
    margin: 0 auto;
}

.eq-list-container {
    padding: 16px;
}

.eq-list-card {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 3px solid #4a6a8a;
    border-radius: 3px;
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.eq-list-card:hover {
    background: #f5f8fb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, #5a5a5a, #3a3a3a);
    color: #aaa;
    text-align: center;
    padding: 12px 20px;
    font-size: 11px;
    margin-top: 20px;
    border-top: 1px solid #222;
}

.footer a {
    color: #8ab;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
    color: #ace;
}

/* Responsive */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-width: 0;
    }
    #map {
        height: 450px;
    }
    .detail-main-row {
        flex-direction: column;
    }
    .detail-info-col {
        width: 100%;
        min-width: 0;
    }
    .detail-title-bar {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
}

/* Epicenter pulse */
@keyframes epicenter-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Scrollbar styling */
.felt-reports-list::-webkit-scrollbar,
.recent-list::-webkit-scrollbar {
    width: 6px;
}

.felt-reports-list::-webkit-scrollbar-track,
.recent-list::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.felt-reports-list::-webkit-scrollbar-thumb,
.recent-list::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
}

.felt-reports-list::-webkit-scrollbar-thumb:hover,
.recent-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}