/* ... (Previous Base CSS) ... */

:root {
    --bg-color: #0d1117;
    --panel-bg: rgba(22, 27, 34, 0.85);
    --text-color: #c9d1d9;
    --accent-color: #58a6ff;
    --danger-color: #f85149;
    --warning-color: #d29922;
    --success-color: #3fb950;
    --border-color: #30363d;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background-color: rgba(22, 27, 34, 0.7);
    /* Daha ÅŸeffaf */
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    /* Daha ince sÄ±nÄ±r */
    /* Safe Area Inset Support */
    padding-top: max(0.8rem, env(safe-area-inset-top));
    padding-bottom: 0.8rem;
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    /* Daha gÃ¼Ã§lÃ¼ blur */
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    /* Height dynamic based on padding */
    height: auto;
    min-height: 60px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.brand-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-title {
    font-size: 1.4rem;
    /* Kurumsal bÃ¼yÃ¼k font */
    font-weight: 800;
    color: var(--text-color);
    /* Default text color, spans will override */
    margin: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
    /* text-shadow removed for cleaner look with colored letters */
}

.letter-u {
    color: #ffab00;
}

/* Turuncu/SarÄ± - UyarÄ± */
.letter-d {
    color: #ff3d00;
}

/* KÄ±rmÄ±zÄ± - Deprem/Risk */
.letter-g {
    color: #2979ff;
}

/* Mavi - GÃ¶zlem/Veri */
.letter-a {
    color: #00e676;
}

/* YeÅŸil - AÄŸ/Kapsama */

.brand-title-full {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.1rem;
    opacity: 0.95;
    display: inline-block;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #8b949e;
    font-weight: 400;
    margin-left: 22px;
    /* Ä°kon hizasÄ± */
    margin-top: 2px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Mobile Adjustments for Title */
@media (max-width: 768px) {
    header {
        padding: 0 10px;
        /* Ã‡entik (Notch) PayÄ± - Sadece gÃ¼venli alan kadar, ekstra yok */
        padding-top: env(safe-area-inset-top);
        min-height: auto;
        padding-bottom: 5px;
        align-items: flex-start;
        justify-content: space-between;
    }

    .brand-container {
        padding-top: 0;
        /* SÄ±fÄ±rlandÄ± */
    }

    .brand-main {
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 0;
        /* BoÅŸluk silindi */
    }

    .brand-title {
        font-size: 1.1rem;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .brand-acronym {
        margin-right: 5px;
    }

    .brand-title-full {
        display: inline-block;
        font-size: 0.9rem;
        /* Okunabilir boyut */
        margin-left: 0;
        white-space: normal;
        max-width: none;
        /* GeniÅŸlik kÄ±sÄ±tlamasÄ±nÄ± kaldÄ±r */
        line-height: 1.2;
    }

    .brand-subtitle {
        display: block;
        font-size: 0.65rem;
        margin-left: 0;
        margin-top: 2px;
        /* AzaltÄ±ldÄ± */
        color: #8b949e;
        white-space: normal;
        line-height: 1.2;
    }

    /* MenÃ¼ butonu hizalamasÄ± */
    #mobile-toggle {
        margin-top: 0;
        align-self: center;
        /* Dikey ortala */

        /* Yeni Sistem Buton Stili */
        background: rgba(255, 255, 255, 0.1);
        /* Hafif Saydam */
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: var(--text-color);
        width: 40px;
        height: 40px;
        border-radius: 12px;
        /* YumuÅŸak KÃ¶ÅŸe */
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        backdrop-filter: blur(5px);
    }

    #mobile-toggle:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.2);
    }
}

.pulse-icon {
    width: 12px;
    height: 12px;
    background-color: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success-color);
    animation: pulse-green 2s infinite;
}

/* Main Layout */
main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Map Container */
#map {
    flex: 1;
    height: 100%;
    z-index: 1;
    background: #0d1117;
    /* Map background to avoid white flashes */
}

/* Filter Panel (Top Left - Collapsible) */
.filter-panel {
    position: absolute;
    top: 10px;
    /* Header zaten safe-area'yÄ± kaplÄ±yor, main onun altÄ±nda baÅŸlÄ±yor. */
    left: 15px;
    /* Sol Ãœst */
    background: rgba(22, 27, 34, 0.8);
    /* Glass effect */
    border-radius: 16px;
    /* Daha yuvarlak */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    /* Biraz daha dar */
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
}

.filter-header:active {
    background: rgba(255, 255, 255, 0.05);
}

.filter-panel.open .filter-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.filter-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-color);
    flex: 1;
    margin-left: 10px;
    text-transform: uppercase;
}

.filter-icon {
    font-size: 1rem;
}

.filter-toggle-icon {
    font-size: 0.7rem;
    color: #8b949e;
    transition: transform 0.3s;
}

.filter-panel.open .filter-toggle-icon {
    transform: rotate(180deg);
}

.filter-content {
    display: none;
    /* JS ile aÃ§Ä±lacak */
    padding: 12px;
    animation: slideDown 0.3s ease;
}

.filter-panel.open .filter-content {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-row {
    margin-bottom: 10px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 0.75rem;
    color: #8b949e;
    margin-bottom: 6px;
    font-weight: 500;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.filter-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #8b949e;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.filter-btn:hover {
    color: white;
}

.filter-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-divider-hz {
    height: 1px;
    background: var(--border-color);
    margin: 10px 0;
    opacity: 0.5;
}

/* Slider Customization */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.4);
    border: 2px solid #fff;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #30363d;
    border-radius: 2px;
    cursor: pointer;
}

/* Sidebar (Recent Quakes) */
.sidebar {
    width: 350px;
    background-color: var(--panel-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Custom Searchable Dropdown */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.custom-select-trigger:hover {
    border-color: var(--accent-color);
}

.custom-options-container {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.custom-select-wrapper.open .custom-options-container {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.search-box {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(22, 27, 34, 0.95);
    border-radius: 8px 8px 0 0;
}

.search-box input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: #0d1117;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 0.85rem;
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent-color);
}

.options-list {
    overflow-y: auto;
    flex: 1;
}

.custom-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.custom-option:hover {
    background-color: rgba(88, 166, 255, 0.1);
}

.custom-option.selected {
    background-color: var(--accent-color);
    color: white;
}

/* Star Icon (Favorite) */
.fav-star {
    font-size: 1.1rem;
    color: #444;
    /* Pasif renk */
    cursor: pointer;
    transition: all 0.2s;
    padding: 2px 6px;
}

.fav-star:hover {
    transform: scale(1.2);
    color: #888;
}

.fav-star.active {
    color: #ffd700;
    /* AltÄ±n SarÄ±sÄ± */
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.custom-option:hover .fav-star {
    opacity: 1;
}

.country-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    /* Standart ok iÅŸaretini kaldÄ±r */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

/* Dropdown Option Fixing (Desktop) */
.country-select option {
    background-color: #161b22;
    /* Koyu Arka Plan */
    color: #c9d1d9;
    /* AÃ§Ä±k YazÄ± */
}

.country-select:hover {
    border-color: var(--accent-color);
}

.quake-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.quake-item {
    background: rgba(48, 54, 61, 0.3);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quake-item:hover {
    background: rgba(48, 54, 61, 0.6);
    border-color: var(--accent-color);
}

.quake-mag {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.quake-info {
    flex: 1;
}

.quake-loc {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.quake-time,
.quake-depth {
    font-size: 0.8rem;
    color: #8b949e;
}

/* Animations */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(63, 185, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
    }
}

@keyframes flash-red {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.new-quake-alert {
    animation: flash-red 1s infinite;
}

/* Leaflet Customization */
.leaflet-popup-content-wrapper {
    background: var(--panel-bg);
    color: var(--text-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.leaflet-popup-tip {
    background: var(--panel-bg);
}

/* Custom Legend Control */
.custom-legend {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
}

.legend-header {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    letter-spacing: 0.5px;
    cursor: pointer;
    /* TÄ±klanabilir */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-content {
    display: block;
    /* VarsayÄ±lan aÃ§Ä±k */
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.legend-row {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.legend-row:last-child {
    margin-bottom: 0;
}

.legend-label {
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent-color);
    width: 14px;
    height: 14px;
}

/* Cluster Styling */
.marker-cluster-custom {
    background-clip: padding-box;
    border-radius: 20px;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    text-align: center;
    font-weight: bold;
    color: #fff;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.marker-cluster-custom div {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Low Danger (Max Mag < 4.0) - Green */
.cluster-mag-low {
    background-color: rgba(63, 185, 80, 0.7);
}

.cluster-mag-low:hover {
    background-color: rgba(63, 185, 80, 0.9);
}

/* Medium Danger (Max Mag 4.0 - 5.9) - Orange */
.cluster-mag-medium {
    background-color: rgba(210, 153, 34, 0.7);
}

.cluster-mag-medium:hover {
    background-color: rgba(210, 153, 34, 0.9);
}

/* High Danger (Max Mag >= 6.0) - Red */
.cluster-mag-high {
    background-color: rgba(248, 81, 73, 0.7);
    animation: pulse-red 2s infinite;
}

.cluster-mag-high:hover {
    background-color: rgba(248, 81, 73, 0.9);
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(248, 81, 73, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0);
    }
}

/* Latest Quake Pulse (Priority) */
/* .latest-quake-container is the Leaflet wrapper - Do NOT animate transform here! */
.latest-quake-container {
    background: transparent !important;
    border: none !important;
}

.pulse-ring {
    width: 100%;
    height: 100%;
    background-color: #f85149;
    border: 2px solid #fff;
    border-radius: 50%;
    /* No shadow initially */
    box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.7);
    animation: pulse-priority 1.5s infinite;
}

@keyframes pulse-priority {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.7);
    }

    70% {
        transform: scale(1.5);
        box-shadow: 0 0 0 15px rgba(248, 81, 73, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0);
    }
}

/* --- Interactive Quake Markers (DOM Based) --- */
.quake-marker-container {
    background: transparent;
    /* Flex alignment for centering the dot in the hit area */
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.quake-dot {
    border-radius: 50%;
    /* Dot size is set inline based on magnitude */
    border: 1px solid rgba(255, 255, 255, 0.7);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Hover / Focus State: Grow & Glow */
.quake-marker-container:hover .quake-dot {
    transform: scale(1.3);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);
    border-color: #fff;
    z-index: 1000;
    /* Ensure hovered item is on top */
}

/* Latest Quake styling adaptation for new structure */
/* .pulse-ring styles are inherited from previous definition */

/* Impact Buffer Animation */
@keyframes expand-buffer {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0.4;
    }
}

.impact-buffer-anim {
    transform-origin: center center;
    animation: expand-buffer 0.8s ease-out forwards;
}

/* Popup Action Button */
.impact-btn {
    width: 100%;
    margin-top: 8px;
    padding: 6px 12px;
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.impact-btn:hover {
    background-color: rgba(88, 166, 255, 0.1);
}

.impact-btn.active {
    background-color: var(--accent-color);
    color: white;
}

.stats-bar {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: #8b949e;
    padding: 10px 1.5rem;
    background: var(--panel-bg);
    border-top: 1px solid var(--border-color);
}

.stat-item strong {
    color: var(--text-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        right: 0;
        bottom: 0;
        /* Sidebar top needs to account for dynamic header height due to notch */
        top: 0;
        padding-top: calc(60px + env(safe-area-inset-top));
        /* Header height substitute */
        transform: translateX(100%);
        width: 85%;
        /* Mobilde biraz daha geniÅŸ */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .mobile-toggle {
        display: block !important;
    }

    .filter-bar {
        width: 90%;
        /* Push down further on mobile since header is taller */
        top: calc(15px + env(safe-area-inset-top));
        flex-direction: column;
        /* Alt alta diz */
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        border-radius: 15px;
        /* Scroll yerine sÄ±ÄŸdÄ±r */
        overflow-x: visible;
        white-space: normal;
    }

    .filter-group {
        justify-content: space-between;
        width: 100%;
    }

    .filter-label {
        font-size: 0.9rem;
        /* Biraz daha okunur */
        min-width: 60px;
    }

    .filter-btn {
        flex: 1;
        /* Butonlar satÄ±rÄ± kaplasÄ±n */
        text-align: center;
        padding: 8px;
        /* Daha bÃ¼yÃ¼k dokunma alanÄ± */
    }

    input[type=range] {
        width: 100%;
        /* Slider tam geniÅŸlik */
    }

    .filter-divider {
        display: none;
        /* Mobilde ayÄ±raÃ§a gerek yok */
    }
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Legend Scale */
.legend-scale {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.scale-header {
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 8px;
    font-weight: 500;
}

.scale-item {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--text-color);
}

.scale-item span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
/* --- Kullanýcý Konumu --- */
.user-dot {
    width: 20px;
    height: 20px;
    background-color: #2196f3;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
    animation: pulse-user 2s infinite;
}

@keyframes pulse-user {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}

.leaflet-control-custom {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
    transition: background 0.2s;
}

.leaflet-control-custom:hover {
    background: #f4f4f4;
}


/* --- Alert Toast (Notification) --- */
.alert-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Arkadaki haritaya týklanabilsin */
    width: 90%;
    max-width: 400px;
}

.alert-toast {
    background: rgba(22, 27, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 16px;
    border-radius: 12px;
    color: var(--text-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: slide-up 0.5s ease-out;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alert-body {
    font-size: 0.85rem;
    color: #8b949e;
    line-height: 1.4;
}

.alert-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.alert-close:hover {
    color: #fff;
}

@keyframes slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* --- Historical Quake Icon --- */
.history-marker {
    background: #4a148c; /* Mor */
    border: 2px solid white;
    border-radius: 5px; /* Karemsi */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.history-marker:hover {
    transform: scale(1.2) rotate(5deg);
    background: #6a1b9a;
}


/* --- Custom Checkbox Styling for Legend --- */
.legend-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 2px 0;
}

.legend-label input[type='checkbox'] {
    accent-color: var(--accent-color); /* Tarayýcý destekleyenlerde mavi */
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-right: 8px;
}

.legend-label:hover {
    opacity: 0.8;
}


/* --- Professional History Module Styles --- */

/* 1. Marker */
.history-marker {
    background: transparent !important; /* Daire olmasýn */
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.history-marker:hover {
    transform: scale(1.2) translateY(-5px);
    z-index: 1000 !important;
}

.history-icon-inner {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #7b1fa2, #4a148c);
    border: 2px solid white;
    border-radius: 50%; /* Daire icinde SVG */
    box-shadow: 0 4px 15px rgba(74, 20, 140, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2. Popup Container */
.history-popup-container {
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.history-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.history-header h3 {
    margin: 0;
    color: #4a148c;
    font-size: 1.1rem;
    font-weight: 700;
}

.history-date {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
    display: block;
}

/* 3. Stats Grid */
.history-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.h-stat {
    background: #f8f9fa;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.h-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 2px;
}

.h-val {
    display: block;
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
}

.h-val.mag { color: #d32f2f; }
.h-val.death { color: #343a40; }

.history-desc {
    font-size: 0.9rem;
    color: #495057;
    background: #fff3cd; /* Hafif sari not kagidi */
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #ffca2c;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* 4. Action Button */
.impact-btn.history-btn {
    background: linear-gradient(to right, #7b1fa2, #9c27b0);
    color: white !important;
    border: none !important;
    padding: 10px 16px;
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(123, 31, 162, 0.4);
    width: 100%;
    margin-top: 5px;
}

.impact-btn.history-btn:hover {
    background: linear-gradient(to right, #6a1b9a, #8e24aa);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(123, 31, 162, 0.5);
}

.impact-btn.history-btn.active {
    background: #424242;
    background: linear-gradient(to right, #424242, #616161);
    box-shadow: none;
}


/* --- WELCOME MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Darker backdrop */
    backdrop-filter: blur(8px);
    z-index: 9999; /* Topmost */
    display: flex; /* Hidden by default via JS if needed, but flex for centering */
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    background: linear-gradient(135deg, #4a148c, #7c43bd);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #30363d;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.modal-body {
    padding: 30px;
    color: #c9d1d9;
    text-align: center;
}

.modal-body p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #8b949e;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .feature-grid {
        grid-template-columns: 1fr; /* Stack on mobile */
        gap: 15px;
        text-align: left;
    }
    
    .feature-item {
        display: flex;
        align-items: center;
        text-align: left !important;
        padding: 10px !important;
    }

    .feature-icon {
        margin-right: 15px;
        margin-bottom: 0 !important;
        font-size: 1.5rem !important;
    }

    .feature-item h3 {
        margin: 0 0 5px 0 !important;
    }

    .feature-item p {
        margin: 0;
        font-size: 0.85rem !important;
    }
}

.feature-item {
    background: #21262d;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #30363d;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-item:hover {
    transform: translateY(-5px);
    border-color: #58a6ff;
}

.feature-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
}

.feature-item h3 {
    color: #f0f6fc;
    font-size: 1rem;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 0.85rem !important; /* Override main p */
    margin: 0 !important;
    color: #8b949e;
    line-height: 1.4;
}

.modal-footer {
    padding: 20px;
    background: #21262d;
    border-top: 1px solid #30363d;
    text-align: center;
}

.modal-btn {
    background: #238636;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.modal-btn:hover {
    background: #2ea043;
    transform: scale(1.05);
}


/* --- Welcome Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999; /* En üstte */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    background: #0d1117;
    padding: 20px 24px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    background: linear-gradient(90deg, #58a6ff, #8b949e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #f85149;
}

.modal-body {
    padding: 24px;
    color: #c9d1d9;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-intro {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #8b949e;
}

.modal-intro strong {
    color: #ffffff;
}

.modal-section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #58a6ff;
    margin-bottom: 15px;
    border-left: 2px solid #58a6ff;
    padding-left: 10px;
}

.modal-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .modal-features-list {
        grid-template-columns: 1fr;
    }
}

.modal-features-list li {
    background: #0d1117;
    border: 1px solid #30363d;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feature-icon {
    font-size: 1.5rem;
}

.modal-features-list strong {
    display: block;
    color: #e6edf3;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.modal-features-list p {
    margin: 0;
    font-size: 0.85rem;
    color: #8b949e;
    line-height: 1.4;
}

.modal-footer-note {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #30363d;
    text-align: center;
    font-size: 0.9rem;
    color: #8b949e;
    font-style: italic;
}

.modal-actions {
    background: #0d1117;
    padding: 20px 24px;
    border-top: 1px solid #30363d;
    display: flex;
    justify-content: flex-end;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #238636, #2ea043);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(46, 160, 67, 0.4);
    transition: all 0.2s ease;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 160, 67, 0.6);
    filter: brightness(1.1);
}


.modal-actions {
    justify-content: space-between; /* Checkbox sol, Button sað */
    align-items: center;
}

.modal-dont-show {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8b949e;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.modal-dont-show input[type="checkbox"] {
    accent-color: #238636;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.modal-dont-show:hover {
    color: #c9d1d9;
}


/* Katman Paneli Toggle Icon Geliþtirme */
.toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #58a6ff;
}

.legend-header:hover .toggle-icon {
    background: rgba(88, 166, 255, 0.2);
    transform: scale(1.1);
    color: #ffffff;
}

