/**
 * Forecast Styles for WordPress Weather Plugin
 * Styles for 5-day, 7-day, hourly forecasts, and comparisons
 */

/* ========================================
   GRAPHIC WEATHER BACKGROUNDS
   ======================================== */

.weather-forecast,
.weather-7day,
.weather-hourly,
.weather-compare {
    position: relative;
    overflow: hidden;
}

.weather-bg-sunny {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%) !important;
}

.weather-bg-sunny::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 200, 0.8) 0%, rgba(255, 200, 100, 0.4) 50%, transparent 70%);
    border-radius: 50%;
    animation: sun-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sun-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.weather-bg-cloudy {
    background: linear-gradient(135deg, #89a4c7 0%, #6b8cae 100%) !important;
}

.weather-bg-cloudy::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    box-shadow: 
        20px 20px 0 -10px rgba(255, 255, 255, 0.5),
        -20px 10px 0 -5px rgba(255, 255, 255, 0.4);
    animation: cloud-float 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cloud-float {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.weather-bg-rainy {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%) !important;
}

.weather-bg-rainy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    background-size: 2px 20px;
    animation: rain-fall 0.5s linear infinite;
    pointer-events: none;
}

@keyframes rain-fall {
    0% { background-position: 0 0; }
    100% { background-position: 10px 20px; }
}

.weather-bg-snowy {
    background: linear-gradient(135deg, #e6e9f0 0%, #eef1f5 100%) !important;
    color: #333 !important;
}

.weather-bg-snowy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.8) 2px, transparent 2px);
    background-size: 30px 30px;
    animation: snow-fall 3s linear infinite;
    pointer-events: none;
}

@keyframes snow-fall {
    0% { background-position: 0 0; }
    100% { background-position: 30px 30px; }
}

.weather-bg-stormy {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
}

.weather-bg-stormy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    animation: lightning 4s infinite;
    pointer-events: none;
}

@keyframes lightning {
    0%, 89%, 91%, 93%, 95%, 100% { background: rgba(255, 255, 255, 0); }
    90%, 92%, 94% { background: rgba(255, 255, 255, 0.3); }
}

.weather-bg-night {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%) !important;
}

.weather-bg-night::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #f5f5dc 0%, #fffacd 30%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 250, 205, 0.5);
    animation: moon-glow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes moon-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 250, 205, 0.5); }
    50% { box-shadow: 0 0 30px rgba(255, 250, 205, 0.8); }
}

.weather-bg-night::after {
    content: '';
    position: absolute;
    top: 40px;
    right: 50px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transform: translateX(-10px);
    pointer-events: none;
}

/* ========================================
   FORECAST CARDS LAYOUT
   ======================================== */

.weather-forecast {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.weather-forecast-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.forecast-day-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Make cards transparent when weather background is active */
.weather-forecast[class*="weather-bg-"] .forecast-day-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.weather-forecast[class*="weather-bg-"] .forecast-day-card:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.forecast-day-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.forecast-date {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.9;
}

.forecast-icon {
    font-size: 2.5rem;
    margin: 10px 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.forecast-desc {
    font-size: 0.85rem;
    margin: 8px 0;
    opacity: 0.95;
}

.forecast-temps {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 12px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.temp-high {
    color: #fff;
}

.temp-low {
    opacity: 0.7;
}

.forecast-precip,
.forecast-wind {
    font-size: 0.8rem;
    margin: 5px 0;
    opacity: 0.9;
}

/* ========================================
   FORECAST LIST LAYOUT
   ======================================== */

.weather-forecast-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.forecast-day-row {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.forecast-day-row:last-child {
    border-bottom: none;
}

.forecast-day-row:hover {
    background: #f8f9fa;
}

/* Make list rows transparent when weather background is active */
.weather-forecast[class*="weather-bg-"] .forecast-day-row {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-forecast[class*="weather-bg-"] .forecast-day-row:hover {
    background: rgba(255, 255, 255, 0.2);
}

.weather-forecast[class*="weather-bg-"] .forecast-day-row .forecast-date,
.weather-forecast[class*="weather-bg-"] .forecast-day-row .forecast-temps {
    color: white;
}

.weather-forecast[class*="weather-bg-"] .forecast-day-row .forecast-desc {
    color: rgba(255, 255, 255, 0.9);
}

.forecast-day-row .forecast-date {
    font-weight: 600;
    color: #495057;
    min-width: 150px;
}

.forecast-details {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.forecast-day-row .forecast-icon {
    font-size: 1.5rem;
    margin: 0;
}

.forecast-day-row .forecast-desc {
    color: #6c757d;
    margin: 0;
}

.forecast-day-row .forecast-temps {
    color: #495057;
    font-weight: 600;
    margin: 0;
}

.forecast-day-row .forecast-precip {
    color: #0dcaf0;
    margin: 0;
}

/* ========================================
   FORECAST TABLE LAYOUT
   ======================================== */

.weather-forecast-table {
    overflow-x: auto;
}

.forecast-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.forecast-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.forecast-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.forecast-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.forecast-table tbody tr:last-child td {
    border-bottom: none;
}

.forecast-table tbody tr:hover {
    background: #f8f9fa;
}

/* Make table transparent when weather background is active */
.weather-forecast[class*="weather-bg-"] .forecast-table {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-forecast[class*="weather-bg-"] .forecast-table thead {
    background: rgba(102, 126, 234, 0.3);
}

.weather-forecast[class*="weather-bg-"] .forecast-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
}

.weather-forecast[class*="weather-bg-"] .forecast-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   HOURLY FORECAST
   ======================================== */

.weather-hourly {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f3f4;
}

.weather-hourly::-webkit-scrollbar {
    height: 8px;
}

.weather-hourly::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.weather-hourly::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.hourly-item {
    flex: 0 0 auto;
    min-width: 80px;
    text-align: center;
    padding: 15px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.hourly-item:hover {
    transform: scale(1.05);
}

.hourly-time {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.9;
}

.hourly-icon {
    font-size: 2rem;
    margin: 8px 0;
}

.hourly-temp {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 8px 0;
}

.hourly-precip {
    font-size: 0.75rem;
    margin-top: 5px;
    opacity: 0.9;
}

/* ========================================
   WEATHER COMPARISON
   ======================================== */

.weather-comparison {
    margin: 20px 0;
}

.weather-comparison-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.comparison-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.comparison-card:hover {
    transform: translateY(-5px);
}

.comparison-card h4 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.comparison-icon {
    font-size: 3rem;
    margin: 10px 0;
}

.comparison-temp {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.comparison-desc {
    font-size: 0.9rem;
    margin: 10px 0;
    opacity: 0.95;
}

.comparison-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.weather-comparison-table {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.comparison-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:hover {
    background: #f8f9fa;
}

/* ========================================
   WEATHER ALERTS
   ======================================== */

.weather-alerts {
    margin: 20px 0;
}

.weather-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.weather-alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.weather-alert-danger {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.weather-alert-info {
    background: #d1ecf1;
    border-left: 4px solid #0dcaf0;
    color: #0c5460;
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .weather-forecast-cards {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .forecast-day-card {
        padding: 15px;
    }
    
    .forecast-icon {
        font-size: 2rem;
    }
    
    .forecast-temps {
        font-size: 1rem;
    }
    
    .forecast-day-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .forecast-details {
        width: 100%;
        justify-content: space-between;
    }
    
    .weather-hourly {
        padding: 15px;
    }
    
    .hourly-item {
        min-width: 70px;
        padding: 12px 8px;
    }
    
    .weather-comparison-cards {
        grid-template-columns: 1fr;
    }
    
    .comparison-card {
        padding: 20px;
    }
    
    .forecast-table {
        font-size: 0.85rem;
    }
    
    .forecast-table th,
    .forecast-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .weather-forecast-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .forecast-day-card {
        padding: 12px;
    }
    
    .forecast-icon {
        font-size: 1.8rem;
    }
    
    .hourly-item {
        min-width: 60px;
    }
    
    .hourly-icon {
        font-size: 1.5rem;
    }
    
    .comparison-icon {
        font-size: 2.5rem;
    }
    
    .comparison-temp {
        font-size: 1.5rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .weather-forecast,
    .weather-hourly,
    .weather-comparison,
    .weather-alerts {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .forecast-day-card,
    .hourly-item,
    .comparison-card {
        background: white !important;
        color: black !important;
        border: 1px solid #ddd !important;
    }
    
    .forecast-table thead {
        background: #f8f9fa !important;
        color: black !important;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .weather-forecast-list,
    .forecast-table,
    .weather-hourly {
        background: #2d3748;
    }
    
    .forecast-day-row,
    .forecast-table td {
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .forecast-day-row:hover,
    .forecast-table tbody tr:hover {
        background: #374151;
    }
    
    .forecast-day-row .forecast-date,
    .forecast-day-row .forecast-temps {
        color: #e2e8f0;
    }
    
    .comparison-table {
        background: #2d3748;
    }
    
    .comparison-table td {
        color: #e2e8f0;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.weather-forecast:focus-within,
.weather-hourly:focus-within,
.weather-comparison:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.forecast-day-card:focus,
.hourly-item:focus,
.comparison-card:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .forecast-day-card,
    .hourly-item,
    .comparison-card,
    .forecast-day-row {
        transition: none;
    }
}