/**
 * Custom Styles for Weather & Tornado Tracker
 * Complements Tailwind CSS with specific styling
 */

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #111827;
    color: white;
}

/* Navigation Bar */
nav {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-btn {
    position: relative;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-1px);
}

.nav-btn.active {
    color: white !important;
    background-color: rgba(59, 130, 246, 0.2);
}

/* Section Container */
.section-content {
    min-height: calc(100vh - 4rem);
}

/* Tornado Section */
#map {
    width: 100%;
    height: calc(100vh - 4rem);
    z-index: 1;
}

#tornadoDashboard {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}


/* Warning Panel Animations */
@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.animate-pulse-red {
    animation: pulse-red 2s infinite;
}

/* Warning Panel */
#tornadoWarningPanel {
    transition: all 0.3s ease-in-out;
}

#tornadoWarningPanel.extreme {
    animation: pulse-red 1s infinite;
}

/* Weather Section */
.weather-section {
    background: linear-gradient(135deg, #111827 0%, #1F2937 100%);
}

.chart-container {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Input Styling */
input[type="text"],
input[type="number"] {
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mock Mode Button */
#mockModeBtn {
    transition: all 0.3s ease;
}

#mockModeBtn.mock-on {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

#mockModeBtn.mock-off {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

/* Tornado Risk Indicators */
.risk-low {
    color: #10B981;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.risk-moderate {
    color: #F59E0B;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.risk-high {
    color: #EF4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.risk-extreme {
    color: #7C2D12;
    text-shadow: 0 0 8px rgba(124, 45, 18, 0.5);
    font-weight: bold;
}

/* Loading Animation */
@keyframes loading-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.loading {
    animation: loading-pulse 1.5s ease-in-out infinite;
}

/* Chart Styling */
canvas {
    max-height: 300px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    nav .container {
        padding: 0 1rem;
    }
    
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    #tornadoDashboard {
        padding: 1rem;
    }
    
    .weather-panel {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    #tornadoSearchInput {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    #tornadoDashboard {
        padding: 0.75rem;
    }
    
    .weather-panel {
        grid-template-columns: 1fr;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.125rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .nav-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    background: rgba(31, 41, 55, 0.95);
    color: white;
    border-radius: 0.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.leaflet-popup-content-wrapper .leaflet-popup-content {
    color: white;
    margin: 0.75rem;
}

.leaflet-popup-tip {
    background: rgba(31, 41, 55, 0.95);
}

.leaflet-popup-close-button {
    color: white !important;
}

/* Map Marker Customization */
.custom-marker {
    background: rgba(239, 68, 68, 0.8);
    border: 2px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
}

/* Alert Banner Styling */
.alert-banner {
    position: relative;
    overflow: hidden;
}

.alert-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Bachata Section */
.bachata-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 4rem);
    background: linear-gradient(135deg, #111827 0%, #1F2937 100%);
}

/* Smooth Transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Focus States */
button:focus,
input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav {
        display: none;
    }
    
    #tornadoDashboard {
        position: relative;
        background: white;
        color: black;
    }
    
    .leaflet-control-container {
        display: none;
    }
}

/* Hidden class utility */
.hidden {
    display: none !important;
}

/* Block class utility */
.block {
    display: block !important;
}
