/* Custom Styles for Afet Bildirim */

/* Grid Pattern Background */
.bg-grid-pattern {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 8s ease-in-out infinite;
}

/* Emergency FAB Pulse */
.pulse-ring {
    position: relative;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7),
                    0 10px 30px rgba(234, 88, 12, 0.3);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(234, 88, 12, 0),
                    0 15px 40px rgba(234, 88, 12, 0.4);
    }
}

/* Mobile Navigation Items */
.nav-item {
    color: #9ca3af;
    transition: all 0.2s ease;
}

.nav-item.active {
    color: #0284c7;
}

.nav-item:active {
    transform: scale(0.95);
}

/* Girişim Savaşçısı Badge */
.gs-badge {
    position: relative;
    overflow: hidden;
}

.gs-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.pulse-glow {
    animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.3);
    }
}

/* Slow pulse animation for filter icon */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Filter Buttons */
.filter-btn {
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: #0284c7;
    color: #0284c7;
}

.filter-btn.active {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

/* Compact Filter Buttons - Modern Glass Style */
.compact-filter-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(147, 197, 253, 0.3);
    color: rgba(255, 255, 255, 0.95);
    padding: 0.65rem 1rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.compact-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.compact-filter-btn:hover::before {
    left: 100%;
}

.compact-filter-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.25) 100%);
    border-color: rgba(147, 197, 253, 0.5);
    color: #ffffff;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4), 0 0 20px rgba(59, 130, 246, 0.2);
}

.compact-filter-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 2px solid #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.8), 0 8px 16px rgba(59, 130, 246, 0.4);
    font-weight: 700;
    transform: scale(1.05);
}

.compact-filter-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Time Filter Specific Styles - Green Theme */
.time-filter.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid #34d399;
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.8), 0 8px 16px rgba(16, 185, 129, 0.4);
}

/* Studio Mode Styles */
#map-wrapper.studio-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
}

#map-wrapper.studio-mode #disaster-map {
    height: 100vh !important;
}

/* Hide scrollbar in studio mode */
body.studio-active {
    overflow: hidden;
}

/* Filter Panel Slide Animation - SOLDAN */
#filters-panel {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#filters-panel.hidden {
    transform: translateX(-100%) translateY(-50%) !important;
    pointer-events: none;
}

/* Earthquake List Panel Slide Animation - SAĞDAN */
#earthquake-list-panel {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#earthquake-list-panel.hidden {
    transform: translateX(100%) translateY(-50%) !important;
    pointer-events: none;
}

/* Mobile Fullscreen - Panel tam genişlik */
@media (max-width: 768px) {
    body.studio-active #earthquake-list-content {
        width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        z-index: 10000 !important;
    }

    body.studio-active #earthquake-list-panel {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        transform: none !important;
    }
}

/* Filter Toggle Icon Rotation */
#filter-toggle svg {
    transition: transform 0.3s ease;
}

#filters-panel.hidden ~ #filter-toggle svg {
    transform: rotate(180deg);
}

/* Loading Overlay */
#map-loading.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Improved Heatmap Colors */
.leaflet-heatmap-layer {
    opacity: 0.8 !important;
}

/* Responsive adjustments for compact filters */
@media (max-width: 768px) {
    .compact-filter-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #0284c7;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0369a1;
}

/* Map Marker Custom Styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content {
    margin: 16px;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Settings Popup Custom Styles */
.settings-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 350px !important;
}

.settings-popup .leaflet-popup-content {
    margin: 20px;
    min-width: 280px;
}

.settings-popup .leaflet-popup-tip {
    display: none;
}

/* Mobile Navigation Active State */
.mobile-nav-item.active {
    color: #0284c7;
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Counter Animation will be handled by JavaScript */
.counter {
    transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* PWA-like mobile experience */
@media (max-width: 768px) {
    body {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    button, a {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 2px;
}

/* Earthquake List Item Styles - ULTRA COMPACT */
.earthquake-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.2rem;
    padding: 0.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.earthquake-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.earthquake-item:active {
    transform: translateX(-1px) scale(0.98);
}

/* Highlighted earthquake (top priority) */
.earthquake-item.highlighted {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.earthquake-item.highlighted::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
    }
}

.earthquake-magnitude {
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    font-weight: 700;
    font-size: 0.65rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.magnitude-high {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
}

.magnitude-medium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.magnitude-low {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

/* Print styles */
@media print {
    .mobile-nav, header, footer {
        display: none;
    }
}

/* Shock Wave Animation for Largest Earthquake */
@keyframes shockwave {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(2.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes shockwave-double {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    30% {
        opacity: 0.8;
    }
    60% {
        transform: scale(3);
        opacity: 0.3;
    }
    100% {
        transform: scale(5);
        opacity: 0;
    }
}

.earthquake-shockwave::before,
.earthquake-shockwave::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid;
    border-color: inherit;
    pointer-events: none;
}

.earthquake-shockwave::before {
    animation: shockwave 2s ease-out infinite;
}

.earthquake-shockwave::after {
    animation: shockwave-double 2.5s ease-out infinite;
    animation-delay: 0.3s;
}

/* Intense pulse for largest earthquake */
@keyframes earthquake-intense-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.9);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px 10px rgba(239, 68, 68, 0);
    }
}

.earthquake-largest {
    animation: earthquake-intense-pulse 1.5s ease-in-out infinite;
}

/* Enhanced Earthquake Popup Styles */
.earthquake-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 16px;
    background: white;
}

.earthquake-popup .leaflet-popup-content {
    margin: 0;
    min-width: 280px;
    max-width: 320px;
    font-family: system-ui, -apple-system, sans-serif;
}

.earthquake-popup .leaflet-popup-tip-container {
    display: block;
}

.earthquake-popup .leaflet-popup-close-button {
    color: #6b7280 !important;
    font-size: 20px !important;
    padding: 8px 12px !important;
    right: 8px !important;
    top: 8px !important;
}

.earthquake-popup .leaflet-popup-close-button:hover {
    color: #1f2937 !important;
}

.earthquake-popup button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.earthquake-popup button:active {
    transform: translateY(0);
}
