/**
 * Deprem OBS Overlay Stil Dosyası
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    background: transparent;
}

.earthquake-overlay {
    position: fixed;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 15px;
    color: #FFFFFF;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    max-height: 600px;
    overflow-y: auto;
    width: 400px;
}

/* Overlay başlangıçta gizli (JavaScript ile gösterilecek) */
body:not(.show-earthquakes) .earthquake-overlay:not(.force-visible) {
    display: none !important;
}

/* Overlay gizleme için güçlü kontrol - HER ZAMAN çalışmalı */
.earthquake-overlay.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Eğer show_earthquakes kapalıysa overlay'i gizle */
body:not(.show-earthquakes) .earthquake-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.earthquake-overlay::-webkit-scrollbar {
    width: 6px;
}

.earthquake-overlay::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.earthquake-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.earthquake-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Pozisyonlar */
.position-top-left {
    top: 20px;
    left: 20px;
}

.position-top-right {
    top: 20px;
    right: 20px;
}

.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* Header */
.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.overlay-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #4CAF50;
}

.status-dot.disconnected {
    background: #f44336;
    animation: none;
}

.status-dot.connecting {
    background: #FF9800;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Deprem Listesi */
.earthquake-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.earthquake-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px;
    border-left: 3px solid #2196F3;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.earthquake-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.earthquake-item.new {
    border-left-color: #FF5722;
    animation: highlight 1s ease;
}

@keyframes highlight {
    0% {
        background: rgba(255, 87, 34, 0.3);
    }
    100% {
        background: rgba(255, 255, 255, 0.1);
    }
}

.earthquake-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.magnitude {
    font-size: 18px;
    font-weight: bold;
    color: #FFC107;
}

.magnitude.major {
    color: #FF5722;
}

.magnitude.medium {
    color: #FF9800;
}

.magnitude.minor {
    color: #4CAF50;
}

.place {
    font-weight: 600;
    font-size: 14px;
    color: #FFFFFF;
}

.earthquake-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-item span {
    opacity: 0.7;
}

.time {
    color: rgba(255, 255, 255, 0.6);
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Alert Popup */
.earthquake-alert {
    position: fixed;
    left: 50%;
    bottom: 8vh;
    transform: translateX(-50%);
    z-index: 20000;
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.98) 0%, rgba(255, 152, 0, 0.98) 100%);
    border-radius: 20px;
    padding: 28px 32px;
    color: #FFFFFF;
    font-size: 20px;
    box-shadow: rgba(255, 87, 34, 0.8) 0 12px 48px,
                rgba(255, 87, 34, 0.6) 0 0 60px,
                rgba(255, 255, 255, 0.1) 0 0 30px inset;
    backdrop-filter: blur(15px);
    border: 4px solid rgba(255, 255, 255, 0.5);
    width: clamp(300px, 80vw, 650px);
    text-align: center;
    display: none;
    overflow: visible;
}

.earthquake-alert::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 25px;
    background: radial-gradient(circle, rgba(255, 87, 34, 0.3) 0%, transparent 70%);
    animation: rippleWave 2s ease-out infinite;
    z-index: -1;
}

.earthquake-alert::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 30px;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.2) 0%, transparent 70%);
    animation: rippleWave 2s ease-out infinite 0.5s;
    z-index: -2;
}

@keyframes rippleWave {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.earthquake-alert.show {
    display: block;
    animation: alertSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
               alertShake 0.5s ease-in-out 0.4s,
               alertPulseBox 1.5s ease-in-out 0.9s infinite,
               alertGlow 2s ease-in-out infinite;
}

.earthquake-alert.hide {
    animation: alertSlideOut 0.5s ease-in forwards;
}

@keyframes alertSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
    60% {
        transform: translateX(-50%) translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes alertShake {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg) scale(1); }
    10% { transform: translateX(-50.5%) translateY(-2px) rotate(-1deg) scale(1.01); }
    20% { transform: translateX(-49.5%) translateY(2px) rotate(1deg) scale(1.01); }
    30% { transform: translateX(-50.5%) translateY(-2px) rotate(-1deg) scale(1.01); }
    40% { transform: translateX(-49.5%) translateY(2px) rotate(1deg) scale(1.01); }
    50% { transform: translateX(-50.3%) translateY(-1px) rotate(-0.5deg) scale(1.005); }
    60% { transform: translateX(-49.7%) translateY(1px) rotate(0.5deg) scale(1.005); }
    70%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg) scale(1); }
}

@keyframes alertSlideOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
}

@keyframes alertPulseBox {
    0%, 100% {
        box-shadow: 0 12px 48px rgba(255, 87, 34, 0.8), 
                    0 0 60px rgba(255, 87, 34, 0.6),
                    0 0 80px rgba(255, 152, 0, 0.4);
    }
    50% {
        box-shadow: 0 16px 64px rgba(255, 87, 34, 1), 
                    0 0 100px rgba(255, 87, 34, 0.9),
                    0 0 140px rgba(255, 152, 0, 0.7);
    }
}

@keyframes alertGlow {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.5);
        background: linear-gradient(135deg, rgba(255, 87, 34, 0.98) 0%, rgba(255, 152, 0, 0.98) 100%);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.9);
        background: linear-gradient(135deg, rgba(255, 107, 54, 1) 0%, rgba(255, 172, 20, 1) 100%);
    }
}

.alert-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.alert-icon {
    font-size: 64px;
    animation: iconAnimate 2s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
    transform-origin: center;
}

@keyframes iconAnimate {
    0%, 100% { 
        transform: translateX(0) translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
    }
    10% { 
        transform: translateX(-4px) translateY(-3px) rotate(-8deg) scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
    }
    20% { 
        transform: translateX(4px) translateY(3px) rotate(8deg) scale(1.15);
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1));
    }
    30% { 
        transform: translateX(-3px) translateY(-2px) rotate(-6deg) scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
    }
    40% { 
        transform: translateX(3px) translateY(2px) rotate(6deg) scale(1.15);
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1));
    }
    50% { 
        transform: translateX(-2px) translateY(-1px) rotate(-4deg) scale(1.2);
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 1));
    }
    60% { 
        transform: translateX(2px) translateY(1px) rotate(4deg) scale(1.15);
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1));
    }
    70% { 
        transform: translateX(-1px) translateY(-1px) rotate(-2deg) scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
    }
    80% { 
        transform: translateX(1px) translateY(1px) rotate(2deg) scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1));
    }
    90% { 
        transform: translateX(0) translateY(0) rotate(0deg) scale(1.05);
        filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.95));
    }
}

.alert-magnitude {
    font-size: 56px;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7),
                 0 0 20px rgba(255, 255, 255, 0.5),
                 0 0 40px rgba(255, 255, 255, 0.3);
    animation: magnitudePulse 1s ease-in-out infinite;
    display: inline-block;
    letter-spacing: 2px;
}

@keyframes magnitudePulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7),
                     0 0 20px rgba(255, 255, 255, 0.5),
                     0 0 40px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.12);
        text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8),
                     0 0 35px rgba(255, 255, 255, 0.7),
                     0 0 70px rgba(255, 255, 255, 0.5);
    }
}

.alert-magnitude.major {
    color: #FF1744;
    animation: magnitudeAnimate 1s ease-in-out infinite;
}

@keyframes magnitudeAnimate {
    0%, 100% { 
        transform: scale(1) translateX(0);
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7),
                     0 0 20px rgba(255, 23, 68, 0.8),
                     0 0 40px rgba(255, 23, 68, 0.6),
                     0 0 60px rgba(255, 23, 68, 0.4);
    }
    25% { 
        transform: scale(1.15) translateX(-3px);
        text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8),
                     0 0 30px rgba(255, 23, 68, 1),
                     0 0 60px rgba(255, 23, 68, 0.8),
                     0 0 80px rgba(255, 23, 68, 0.6);
    }
    50% { 
        transform: scale(1.2) translateX(0);
        text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.9),
                     0 0 40px rgba(255, 23, 68, 1),
                     0 0 80px rgba(255, 23, 68, 0.9),
                     0 0 100px rgba(255, 23, 68, 0.7);
    }
    75% { 
        transform: scale(1.15) translateX(3px);
        text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8),
                     0 0 30px rgba(255, 23, 68, 1),
                     0 0 60px rgba(255, 23, 68, 0.8),
                     0 0 80px rgba(255, 23, 68, 0.6);
    }
}

.alert-magnitude.medium {
    color: #FF6F00;
}

.alert-magnitude.minor {
    color: #FFC400;
}

.alert-title {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7),
                 0 0 15px rgba(255, 255, 255, 0.5);
    animation: titleBlink 1.5s ease-in-out infinite;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

@keyframes titleBlink {
    0%, 100% {
        opacity: 1;
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7),
                     0 0 15px rgba(255, 255, 255, 0.5);
    }
    50% {
        opacity: 0.9;
        text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8),
                     0 0 25px rgba(255, 255, 255, 0.8),
                     0 0 40px rgba(255, 255, 255, 0.6);
    }
}

.alert-place {
    font-size: 22px;
    margin-bottom: 15px;
    opacity: 0.95;
    font-weight: 600;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.alert-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 15px;
    margin-top: 15px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.alert-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.alert-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
    font-size: 26px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.alert-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Responsive */
@media (max-width: 500px) {
    .earthquake-overlay {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    
    .earthquake-alert {
        width: 90%;
        padding: 24px 20px;
        font-size: 16px;
        bottom: 5vh;
    }
    
    .alert-magnitude {
        font-size: 36px;
    }
    
    .alert-title {
        font-size: 20px;
    }
    
    .alert-place {
        font-size: 18px;
    }
}

