/**
 * Modern Weather Interface CSS
 * Enhanced components while maintaining retro arcade theme
 */

/* Modal System */
.weather-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.weather-modal.modal-opening {
    animation: fadeIn 0.3s ease-in-out;
}

.weather-modal.modal-closing {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-content {
    background: linear-gradient(135deg, #000022 0%, #001144 50%, #000022 100%);
    border: 4px solid #00FFFF;
    border-radius: 12px;
    box-shadow: 
        0 0 30px #00FFFF88,
        0 0 60px #FF00FF44,
        inset 0 0 0 2px #FFFF0088;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #222244 0%, #000022 100%);
    border-bottom: 3px solid #00FF00;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #FFFF00;
    margin: 0;
    font-size: 1.2em;
    text-shadow: 2px 2px #FF00FF;
}

.modal-close {
    color: #FF0000;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 5px;
    border-radius: 5px;
}

.modal-close:hover {
    color: #FFFFFF;
    background-color: #FF0000;
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 12px;
}

.modal-body::-webkit-scrollbar-track {
    background: #000022;
    border-radius: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #00FFFF, #FF00FF);
    border-radius: 6px;
    border: 2px solid #000022;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #FFFF00, #00FF00);
}

/* Tab System */
.detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #00FF00;
    padding-bottom: 10px;
}

.tab-button {
    background: linear-gradient(135deg, #333366 0%, #222244 100%);
    color: #FFFFFF;
    border: 2px solid #00FFFF;
    padding: 8px 12px;
    font-size: 0.7em;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 5px;
    text-transform: uppercase;
}

.tab-button:hover {
    background: linear-gradient(135deg, #444477 0%, #333355 100%);
    border-color: #FFFF00;
    transform: translateY(-1px);
}

.tab-button.active {
    background: linear-gradient(135deg, #00FFFF 0%, #0088CC 100%);
    color: #000000;
    border-color: #FFFF00;
    box-shadow: 0 0 10px #00FFFF88;
}

.tab-content {
    min-height: 300px;
}

.tab-pane {
    display: none;
    animation: tabFadeIn 0.3s ease-in-out;
}

.tab-pane.active {
    display: block;
}

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

/* Weather Detail Grid */
.weather-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-card {
    background: linear-gradient(135deg, #222244 0%, #111133 100%);
    border: 3px solid #00FF00;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.2);
}

.detail-card:hover {
    border-color: #FFFF00;
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(255, 255, 0, 0.3);
}

.detail-card h4 {
    color: #00FFFF;
    margin: 0 0 10px 0;
    font-size: 0.8em;
    text-transform: uppercase;
}

.detail-value {
    color: #FFFF00;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px #000000;
}

.detail-sub {
    color: #FF00FF;
    font-size: 0.6em;
    margin-top: 5px;
}

/* Hourly Forecast */
.hourly-forecast-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
}

.hourly-item {
    background: linear-gradient(135deg, #333366 0%, #222244 100%);
    border: 2px solid #00FFFF;
    border-radius: 8px;
    padding: 10px;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.hourly-item:hover {
    border-color: #FFFF00;
    transform: scale(1.05);
}

.hour-time {
    color: #00FFFF;
    font-size: 0.6em;
    margin-bottom: 5px;
}

.hour-icon {
    font-size: 1.5em;
    margin: 5px 0;
}

.hour-temp {
    color: #FFFF00;
    font-size: 0.8em;
    font-weight: bold;
    margin: 5px 0;
}

.hour-precip {
    color: #00FF00;
    font-size: 0.6em;
    margin: 3px 0;
}

.hour-wind {
    color: #FF00FF;
    font-size: 0.5em;
    margin-top: 3px;
}

/* Daily Forecast */
.daily-detail-header {
    color: #FFFF00; /* Yellow for prominence */
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 2px 2px #FF00FF;
    border-bottom: 2px dashed #00FF00;
    padding-bottom: 8px;
}

.daily-forecast-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.daily-item {
    background: linear-gradient(135deg, #222244 0%, #111133 100%);
    border: 2px solid #00FF00;
    border-radius: 8px;
    padding: 15px;
    display: grid;
    grid-template-columns: 120px 60px 1fr 100px 80px 80px 60px;
    gap: 15px;
    align-items: center;
    transition: all 0.3s ease;
}

.daily-item:hover {
    border-color: #FFFF00;
    background: linear-gradient(135deg, #333355 0%, #222244 100%);
    transform: translateX(5px);
}

.daily-date {
    color: #00FFFF;
    font-size: 0.7em;
    font-weight: bold;
}

.daily-icon {
    font-size: 1.8em;
    text-align: center;
}

.daily-desc {
    color: #FFFFFF;
    font-size: 0.7em;
}

.daily-temps {
    text-align: center;
}

.temp-high {
    color: #FFFF00;
    font-weight: bold;
    font-size: 0.8em;
}

.temp-low {
    color: #00FFFF;
    font-size: 0.7em;
}

.daily-precip {
    color: #00FF00;
    font-size: 0.6em;
    text-align: center;
}

.daily-wind, .daily-uv {
    color: #FF00FF;
    font-size: 0.6em;
    text-align: center;
}

/* Air Quality */
.air-quality-container {
    text-align: center;
}

.aqi-main {
    background: linear-gradient(135deg, #222244 0%, #111133 100%);
    border: 3px solid #00FFFF;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    display: inline-block;
}

.aqi-value {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px #000000;
}

.aqi-description {
    color: #FFFFFF;
    font-size: 0.8em;
    text-transform: uppercase;
}

.pollutants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.pollutant-item {
    background: linear-gradient(135deg, #333366 0%, #222244 100%);
    border: 2px solid #FF00FF;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s ease;
}

.pollutant-item:hover {
    border-color: #FFFF00;
    transform: translateY(-2px);
}

.pollutant-item h4 {
    color: #00FFFF;
    margin: 0 0 10px 0;
    font-size: 0.7em;
}

.pollutant-value {
    color: #FFFF00;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.pollutant-unit {
    color: #FF00FF;
    font-size: 0.5em;
}

/* Search Interface */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

#locationSearchInput {
    flex: 1;
    min-width: 250px;
    padding: 12px;
    background: linear-gradient(135deg, #222244 0%, #111133 100%);
    border: 2px solid #00FFFF;
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 0.7em;
}

#locationSearchInput:focus {
    outline: none;
    border-color: #FFFF00;
    box-shadow: 0 0 10px #FFFF0088;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.search-result-item {
    background: linear-gradient(135deg, #333366 0%, #222244 100%);
    border: 2px solid #00FF00;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    border-color: #FFFF00;
    background: linear-gradient(135deg, #444477 0%, #333355 100%);
    transform: translateX(5px);
}

.result-name {
    color: #FFFFFF;
    font-size: 0.7em;
}

/* Settings */
.settings-group {
    background: linear-gradient(135deg, #222244 0%, #111133 100%);
    border: 2px solid #00FFFF;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-group h3 {
    color: #FFFF00;
    margin: 0 0 15px 0;
    font-size: 0.9em;
    border-bottom: 1px solid #00FF00;
    padding-bottom: 8px;
}

.settings-group label {
    display: block;
    color: #FFFFFF;
    font-size: 0.7em;
    margin-bottom: 10px;
    cursor: pointer;
}

.settings-group input[type="radio"],
.settings-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: #00FFFF;
}

.settings-group select {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #333366 0%, #222244 100%);
    border: 2px solid #FF00FF;
    border-radius: 4px;
    color: #FFFFFF;
    font-size: 0.6em;
    margin-top: 10px;
}

.settings-group select:focus {
    outline: none;
    border-color: #FFFF00;
    box-shadow: 0 0 8px #FFFF0088;
}

/* Chart Container */
#weatherChartsContainer {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

#weatherChartsContainer canvas {
    background: linear-gradient(135deg, #111133 0%, #000022 100%);
    border: 3px solid #00FF00;
    border-radius: 8px;
    box-shadow: 0 0 15px #00FF0088;
    max-width: 100%;
    height: auto;
}

/* Enhanced Current Conditions */
.weather-detail-trigger {
    cursor: pointer;
    transition: all 0.3s ease;
}

.weather-detail-trigger:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px #FFFF0088;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 0.7em;
    max-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border: 2px solid;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #004400 0%, #002200 100%);
    border-color: #00FF00;
    color: #00FF00;
}

.notification-error {
    background: linear-gradient(135deg, #440000 0%, #220000 100%);
    border-color: #FF0000;
    color: #FF0000;
}

.notification-info {
    background: linear-gradient(135deg, #004444 0%, #002222 100%);
    border-color: #00FFFF;
    color: #00FFFF;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1em;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 70vh;
    }
    
    .detail-tabs {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .tab-button {
        font-size: 0.6em;
        padding: 6px 8px;
    }
    
    .weather-detail-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .detail-card {
        padding: 10px;
    }
    
    .detail-value {
        font-size: 1.2em;
    }
    
    .hourly-forecast-container {
        gap: 8px;
    }
    
    .hourly-item {
        min-width: 70px;
        padding: 8px;
    }
    
    .daily-item {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    #locationSearchInput {
        min-width: auto;
        width: 100%;
    }
    
    .pollutants-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    #weatherChartsContainer canvas {
        width: 100%;
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .weather-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header h2 {
        font-size: 0.9em;
    }
    
    .tab-button {
        font-size: 0.5em;
        padding: 5px 6px;
    }
    
    .detail-value {
        font-size: 1.1em;
    }
    
    .hourly-item {
        min-width: 60px;
        padding: 6px;
    }
    
    .hour-temp {
        font-size: 0.7em;
    }
    
    .aqi-main {
        padding: 20px;
    }
    
    .aqi-value {
        font-size: 2.5em;
    }
    
    .pollutants-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation Enhancements */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px currentColor; }
    50% { box-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

.weather-detail-trigger:hover {
    animation: glow 2s infinite;
}

/* Scrollbar Styling for Better UX */
.hourly-forecast-container::-webkit-scrollbar {
    height: 8px;
}

.hourly-forecast-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.hourly-forecast-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #00FFFF, #FF00FF);
    border-radius: 4px;
}

.hourly-forecast-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #FFFF00, #00FF00);
}

/* Loading States */
.loading {
    position: relative;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid transparent;
    border-top: 3px solid #00FFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Enhanced Button Styles */
.button.primary {
    background: linear-gradient(135deg, #00FFFF 0%, #0088CC 100%);
    border-color: #FFFF00;
    color: #000000;
}

.button.primary:hover {
    background: linear-gradient(135deg, #FFFF00 0%, #CCAA00 100%);
    box-shadow: 0 0 15px #FFFF0088;
}

.button.secondary {
    background: linear-gradient(135deg, #666699 0%, #444477 100%);
    border-color: #00FF00;
    color: #FFFFFF;
}

.button.secondary:hover {
    background: linear-gradient(135deg, #777799 0%, #555577 100%);
    border-color: #00FFFF;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
.tab-button:focus,
.modal-close:focus,
button:focus,
input:focus,
select:focus {
    outline: 3px solid #FFFF00;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modal-content {
        border-width: 6px;
    }
    
    .detail-card,
    .hourly-item,
    .daily-item {
        border-width: 3px;
    }
    
    .tab-button {
        border-width: 3px;
    }
}