/* Weather Dashboard Styles */
.weather-dashboard {
    position: fixed;
    top: 80px;
    right: -400px;
    width: 380px;
    height: calc(100vh - 100px);
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem 0 0 1rem;
    box-shadow: var(--shadow-glow), var(--shadow-strong);
    transition: right var(--transition-normal);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.weather-dashboard.open {
    right: 0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

.weather-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.weather-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.weather-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    max-height: calc(100vh - 140px);
}

/* Current Weather */
.current-weather {
    margin-bottom: 2rem;
}

.weather-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    color: white;
}

.temperature {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.temperature #current-temp {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
}

.temperature .unit {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.8;
}

.weather-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    background: var(--background-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.detail-item.extended {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.detail-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.detail-item span:first-of-type {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-item span:last-of-type {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Forecast Section */
.forecast-section {
    margin-bottom: 2rem;
}

.forecast-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.forecast-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.forecast-day {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.forecast-day:hover {
    background: white;
    box-shadow: var(--shadow-light);
    transform: translateY(-1px);
}

.forecast-day-name {
    font-weight: 600;
    color: var(--text-primary);
}

.forecast-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.forecast-temps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.forecast-high {
    font-weight: 600;
    color: var(--text-primary);
}

.forecast-low {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.forecast-precipitation {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.forecast-details {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.detail-small {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
}

.detail-small i {
    color: var(--primary-color);
    width: 12px;
}

/* Probability Section */
.probability-section {
    margin-bottom: 2rem;
}

.probability-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.probability-section h3:before {
    content: '📊';
}

.probability-charts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.probability-chart {
    background: var(--background-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.probability-chart:hover {
    background: white;
    box-shadow: var(--shadow-light);
    transform: translateY(-1px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.chart-label {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.chart-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.probability-bar {
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.probability-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
    transition: width 0.6s ease-in-out;
    border-radius: 6px;
    position: relative;
}

.probability-fill:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 6px;
}

/* Actions Section */
.actions-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Location Info Panel */
.location-info {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-medium);
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.location-info.show {
    transform: translateY(0);
    opacity: 1;
}

.info-header h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.info-header p {
    color: var(--text-secondary);
    margin: 0;
}

.location-details {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.location-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.location-detail i {
    color: var(--primary-color);
    width: 16px;
}

/* Weather Conditions Styling */
.weather-condition-sunny .weather-icon {
    color: #f59e0b;
}

.weather-condition-cloudy .weather-icon {
    color: #6b7280;
}

.weather-condition-rainy .weather-icon {
    color: #3b82f6;
}

.weather-condition-snowy .weather-icon {
    color: #e5e7eb;
}

.weather-condition-stormy .weather-icon {
    color: #374151;
}

/* Weather Alerts */
.weather-alerts {
    margin-bottom: 2rem;
}

.weather-alerts h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weather-alerts h4:before {
    content: '⚠️';
}

.weather-alert {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.weather-alert.severe {
    background: #fee2e2;
    border-color: #ef4444;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #92400e;
}

.alert-header.severe {
    color: #dc2626;
}

.alert-description {
    font-size: 0.875rem;
    color: #78350f;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.alert-description.severe {
    color: #991b1b;
}

.alert-time {
    font-size: 0.8rem;
    color: #a16207;
    font-style: italic;
}

/* Extended Weather Details */
.detail-item.extended {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* Air Quality Section */
.air-quality-section {
    margin-bottom: 2rem;
}

.air-quality-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.air-quality-section h3:before {
    content: '🌬️';
}

.aqi-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
}

.aqi-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: var(--border-radius);
    min-width: 100px;
}

.aqi-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.aqi-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.aqi-good {
    background: #dcfce7;
    color: #166534;
}

.aqi-fair {
    background: #fef3c7;
    color: #92400e;
}

.aqi-moderate {
    background: #fed7aa;
    color: #9a3412;
}

.aqi-poor {
    background: #fecaca;
    color: #dc2626;
}

.aqi-very-poor {
    background: #f3e8ff;
    color: #7c2d12;
}

.aqi-description {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pollutants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.pollutant-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.pollutant-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.pollutant-item span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Sun & Moon Section */
.sun-moon-section {
    margin-bottom: 2rem;
}

.sun-moon-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sun-moon-section h3:before {
    content: '☀️';
}

.sun-moon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.sun-moon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.sun-moon-item:hover {
    background: white;
    box-shadow: var(--shadow-light);
}

.sun-moon-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.sun-moon-item i.sunrise {
    color: #f59e0b;
}

.sun-moon-item i.sunset {
    color: #ea580c;
}

.sun-moon-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.sun-moon-item span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Enhanced Hourly Forecast */
.hourly-forecast h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.hourly-forecast h4:before {
    content: '🕐';
}

.hourly-item {
    min-width: 120px;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    padding: 1rem 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.hourly-item:hover {
    background: white;
    box-shadow: var(--shadow-light);
    transform: translateY(-2px);
}

.hourly-wind {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.hourly-wind i {
    color: var(--primary-color);
}

.hourly-pressure {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.hourly-pressure i {
    color: var(--primary-color);
}

/* Weather Map Integration */
.weather-map-section {
    margin-bottom: 2rem;
}

.weather-map-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.map-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.map-layer-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.map-layer-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mini-map {
    height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--background-secondary);
    position: relative;
}

/* Export Options Modal */
.export-options-modal .modal-content {
    max-width: 600px;
    width: 90%;
}

.export-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.export-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.export-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.export-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.export-checkbox:hover {
    background: white;
    box-shadow: var(--shadow-light);
}

.export-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.export-checkbox span {
    font-weight: 500;
    color: var(--text-primary);
}

.export-checkbox input[type="checkbox"]:disabled + span {
    color: var(--text-light);
}

.export-format-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.export-format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

.export-format-btn:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-light);
    transform: translateY(-2px);
}

.export-format-btn i {
    font-size: 2rem;
    color: var(--primary-color);
}

.export-format-btn span {
    font-weight: 600;
    font-size: 1rem;
}

.export-format-btn small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .export-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .export-format-buttons {
        grid-template-columns: 1fr;
    }
    
    .export-format-btn {
        padding: 1rem;
    }
    
    .export-format-btn i {
        font-size: 1.5rem;
    }
}

/* Responsive Weather Dashboard */
@media (max-width: 768px) {
    .weather-dashboard {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .weather-dashboard.open {
        right: 0;
    }

    .weather-details {
        grid-template-columns: 1fr;
    }

    .forecast-day {
        grid-template-columns: 1fr auto;
        gap: 0.75rem;
    }

    .forecast-temps,
    .forecast-precipitation {
        grid-column: 2;
        justify-self: end;
    }

    .location-info {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .location-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .pollutants-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sun-moon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aqi-main {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .weather-main {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .temperature #current-temp {
        font-size: 2.5rem;
    }

    .weather-icon {
        font-size: 2.5rem;
    }

    .hourly-container {
        gap: 0.5rem;
        padding-bottom: 1rem;
    }
    
    .hourly-item {
        min-width: 100px;
        padding: 0.75rem 0.5rem;
    }
    
    .forecast-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .weather-alerts {
        margin: 1rem -1rem;
        padding: 0 1rem;
    }
    
    .pollutants-grid {
        grid-template-columns: 1fr;
    }
    
    .sun-moon-grid {
        grid-template-columns: 1fr;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
    }
}

/* Loading states */
.weather-content.loading {
    opacity: 0.6;
    pointer-events: none;
}

.weather-content.loading:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

/* Weather map integration indicators */
.weather-map-active {
    border-left: 4px solid var(--accent-color);
}

.weather-layer-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 500;
}

/* Map legends for weather layers */
.map-legend {
    position: absolute;
    left: 8px;
    min-width: 160px;
    max-width: 240px;
    background: rgba(26, 31, 58, 0.95);
    backdrop-filter: blur(20px);
    color: #e2e8f0;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(2,6,23,0.45);
    border: 1px solid rgba(99, 102, 241, 0.3);
    z-index: 700;
    font-size: 12px;
    font-weight: 600;
}

.map-legend .legend-title {
    font-size: 13px;
    margin-bottom: 6px;
    color: #a5b4fc;
}

.map-legend .legend-scale {
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.map-legend .legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
}

/* Gradient variants */
.legend-gradient-clouds { background: linear-gradient(90deg, rgba(255,255,255,0.0) 0%, rgba(220,220,220,0.9) 50%, rgba(80,80,80,0.95) 100%); }
.legend-gradient-precip { background: linear-gradient(90deg, #e6f2ff, #9fd0ff, #3b82f6); }
.legend-gradient-temp { background: linear-gradient(90deg, #2b81ff, #06b6d4, #10b981, #f59e0b, #ef4444); }
.legend-gradient-wind { background: linear-gradient(90deg, #edf2f7, #c7d2fe, #60a5fa); }
.legend-gradient-pressure { background: linear-gradient(90deg, #dbeafe, #bfdbfe, #f8fafc); }

/* Small close button inside legend for future expansion (not shown by default) */
.map-legend .legend-close {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 11px;
    cursor: pointer;
    color: #94a3b8;
}

/* Weather condition indicators */
.weather-main.condition-clear {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.weather-main.condition-clouds {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.weather-main.condition-rain {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.weather-main.condition-snow {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: var(--text-primary);
}

.weather-main.condition-thunderstorm {
    background: linear-gradient(135deg, #374151, #1f2937);
}
