:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: none;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.stat-box {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
}

/* Alert Items */
.alert-item {
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid;
    background: #f8f9fa;
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
}

.alert-item.critical {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.alert-item.warning {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.alert-item.info {
    border-left-color: #0dcaf0;
    background: #cff4fc;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-time {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Map Markers - Enhanced */
.station-marker-wrapper {
    position: relative;
    width: 30px;
    height: 30px;
}

.station-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
    z-index: 2;
    border: 2px solid white;
}

.station-icon i {
    font-size: 14px;
}

/* Normal station - white satellite */
.station-icon-normal .station-icon {
    background: white;
    border: 2px solid #28a745;
}

/* Seismic station - blue with waves */
.station-icon-seismic .station-icon {
    background: #0d6efd;
    animation: pulse 1s infinite;
    width: 32px;
    height: 32px;
}

/* Displacement station - red building */
.station-icon-displacement .station-icon {
    background: #dc3545;
    animation: shake 0.5s infinite;
    width: 32px;
    height: 32px;
}

/* Offline station - gray */
.station-icon-offline .station-icon {
    background: #6c757d;
    opacity: 0.7;
}

/* Event badges */
.event-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    white-space: nowrap;
    z-index: 3;
}

/* Animations */
.station-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.3);
    animation: pulse 2s infinite;
}

.seismic-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #0d6efd;
    animation: ripple 1.5s infinite;
}

.displacement-arrow {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    color: #ff9800;
    animation: bounce 1s infinite;
}

@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) translateX(0); }
    25% { transform: translate(-50%, -50%) translateX(-3px); }
    75% { transform: translate(-50%, -50%) translateX(3px); }
}

@keyframes slide {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-45%, -50%); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

/* Seismic Event Marker */
.seismic-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    opacity: 0.7;
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Live Data Feed */
.data-feed-item {
    padding: 8px;
    margin-bottom: 5px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
    border-left: 3px solid #0dcaf0;
}

.data-feed-item .timestamp {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Station Details */
.station-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.station-detail-row:last-child {
    border-bottom: none;
}

.station-detail-label {
    font-weight: 600;
    color: #495057;
}

.station-detail-value {
    color: #212529;
}

/* Progress bars */
.progress {
    height: 20px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Tooltips */
.custom-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-value {
        font-size: 1.5rem;
    }
    
    #map {
        height: 400px !important;
    }
}

/* Chart container */
#seismic-chart {
    max-height: 200px;
}

/* Loading spinner */
.spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Station detail modal styles */
.station-detail-container {
    padding: 10px;
    max-height: 80vh;
    overflow-y: auto;
}

.event-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 5px;
}

.event-item {
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.event-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.validation-container {
    max-height: 300px;
    overflow-y: auto;
}

.validation-container table {
    font-size: 0.75rem;
}

#displacement-canvas {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

/* Modal enhancements */
.modal-dialog.modal-lg {
    max-width: 80%;
}

.modal-body {
    max-height: 75vh;
    overflow-y: auto;
}

.tab-content {
    min-height: 350px;
    max-height: 450px;
}

/* Clickable items */
.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable:hover {
    background: rgba(0,123,255,0.1);
    border-left: 3px solid #007bff;
}