/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-bg: #2c3e50;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color), #34495e);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 600;
}

.title-icon {
    width: 32px;
    height: 32px;
    color: var(--warning-color);
}

.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.notification-btn,
.map-toggle-btn,
.refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: auto;
}

.notification-btn {
    background-color: var(--warning-color);
    color: white;
}

.notification-btn:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

.notification-btn.enabled {
    background-color: var(--success-color);
}

.notification-btn.enabled:hover {
    background-color: #229954;
}

.map-toggle-btn,
.refresh-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.map-toggle-btn:hover,
.refresh-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.map-toggle-btn.active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.map-toggle-btn.active:hover {
    background-color: #2980b9;
}

.icon {
    width: 18px;
    height: 18px;
}

/* Main Content */
.main {
    flex: 1;
    padding: 30px 0;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-icon {
    width: 20px;
    height: 20px;
    color: var(--success-color);
}

/* Filters */
.filters {
    display: flex;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.filter-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-group input[type="text"] {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: white;
    transition: var(--transition);
}

.filter-group input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-group input[type="text"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Content Container */
.content-container {
    position: relative;
}

/* Map Styles */
.earthquake-map {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
    transition: var(--transition);
}

.earthquake-map.hidden {
    display: none;
}

.map-container {
    height: 500px;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
    border-radius: var(--border-radius);
}

/* Custom Leaflet popup styles */
.leaflet-popup-content-wrapper {
    border-radius: var(--border-radius);
}

.earthquake-popup {
    min-width: 200px;
}

.earthquake-popup h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.earthquake-popup p {
    margin: 4px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.earthquake-popup .magnitude-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.earthquake-popup .magnitude-badge.low {
    background-color: var(--success-color);
}

.earthquake-popup .magnitude-badge.moderate {
    background-color: var(--warning-color);
}

.earthquake-popup .magnitude-badge.high {
    background-color: var(--danger-color);
}

/* Earthquake List */
.earthquake-list {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

/* Earthquake Item */
.earthquake-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    align-items: center;
}

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

.earthquake-item:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

.magnitude {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1rem;
    color: white;
    text-align: center;
}

.magnitude.low {
    background-color: var(--success-color);
}

.magnitude.moderate {
    background-color: var(--warning-color);
}

.magnitude.high {
    background-color: var(--danger-color);
}

.earthquake-details {
    flex: 1;
}

.earthquake-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.earthquake-location {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.earthquake-depth {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.earthquake-time {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.time-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: var(--border-color);
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
}

.footer p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }

    .title {
        font-size: 1.5rem;
    }

    .controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .status-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        min-width: auto;
    }

    .earthquake-item {
        grid-template-columns: auto 1fr;
        gap: 15px;
    }

    .earthquake-time {
        grid-column: 1 / -1;
        text-align: left;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border-color);
    }

    .magnitude {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .main {
        padding: 20px 0;
    }

    .notification-btn,
    .refresh-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .icon {
        width: 16px;
        height: 16px;
    }

    .earthquake-item {
        padding: 15px;
    }

    .map-container {
        height: 400px;
    }
}

/* Animation for new earthquakes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.earthquake-item.new {
    animation: slideIn 0.5s ease-out;
}

/* Notification permission states */
.notification-btn.denied {
    background-color: var(--danger-color);
    cursor: not-allowed;
}

.notification-btn.denied:hover {
    background-color: var(--danger-color);
    transform: none;
} 