/* ============================================
   CropSaga - Weather Module Styles (Redesigned)
   Sophisticated color palette with agricultural focus
   ============================================ */

/* Weather Module Container */
.weather-module {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Hero Weather Card */
.weather-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #3a7ca5 100%);
    border-radius: 16px;
    padding: var(--spacing-xl);
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(30, 58, 95, 0.3);
}

.weather-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.weather-hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.weather-hero-left {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.weather-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.weather-location i {
    color: #f59e0b;
}

.weather-temp-main {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
}

.weather-icon-large {
    font-size: 72px;
    color: #f59e0b;
    text-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.weather-temp-info {
    display: flex;
    flex-direction: column;
}

.weather-temp-value {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
}

.weather-temp-feels {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

.weather-condition {
    font-size: 24px;
    font-weight: 500;
    margin-top: 8px;
    color: #94d3f7;
}

.weather-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-md);
}

.weather-source-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-source-tag.eosda {
    background: rgba(34, 197, 94, 0.3);
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.weather-source-tag.open-meteo {
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.weather-quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.weather-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.weather-stat i {
    width: 20px;
    opacity: 0.8;
}

.weather-stat.wind i { color: #a5d6ff; }
.weather-stat.humidity i { color: #7dd3fc; }
.weather-stat.pressure i { color: #c4b5fd; }
.weather-stat.clouds i { color: #d4d4d8; }

/* Sun Times Strip */
.weather-sun-strip {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    border-top: 1px solid rgba(255,255,255,0.15);
}

.sun-time-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.sun-time-item i {
    font-size: 20px;
}

.sun-time-item.sunrise i { color: #fcd34d; }
.sun-time-item.sunset i { color: #f97316; }

/* Agricultural Alerts Section */
.weather-alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.weather-alert-card {
    border-radius: 12px;
    padding: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    border: 1px solid;
}

.weather-alert-card.good {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

.weather-alert-card.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.weather-alert-card.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.weather-alert-card.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.weather-alert-card.good .alert-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.weather-alert-card.warning .alert-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.weather-alert-card.danger .alert-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.weather-alert-card.info .alert-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.alert-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--color-text-primary);
}

.alert-content p {
    font-size: 13px;
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* GDD Progress Card */
.gdd-card {
    background: var(--color-card-bg);
    border-radius: 12px;
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
}

.gdd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.gdd-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gdd-header h3 i {
    color: #f59e0b;
}

.gdd-value {
    font-size: 28px;
    font-weight: 700;
    color: #f59e0b;
}

.gdd-value span {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.gdd-progress-bar {
    height: 8px;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: var(--spacing-md) 0;
}

.gdd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.gdd-stages {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-secondary);
}

/* Spray Conditions Widget */
.spray-conditions {
    background: var(--color-card-bg);
    border-radius: 12px;
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
}

.spray-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.spray-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.spray-header h3 i {
    color: #3b82f6;
}

.spray-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.spray-status.optimal {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.spray-status.marginal {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.spray-status.poor {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.spray-factors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.spray-factor {
    text-align: center;
    padding: var(--spacing-sm);
}

.spray-factor-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-xs);
    font-size: 16px;
}

.spray-factor.good .spray-factor-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.spray-factor.warning .spray-factor-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.spray-factor.bad .spray-factor-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.spray-factor-label {
    font-size: 11px;
    color: var(--color-text-secondary);
}

.spray-factor-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Weekly Precipitation Summary */
.precip-summary {
    background: var(--color-card-bg);
    border-radius: 12px;
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
}

.precip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.precip-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.precip-header h3 i {
    color: #06b6d4;
}

.precip-total {
    font-size: 24px;
    font-weight: 700;
    color: #06b6d4;
}

.precip-total span {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.precip-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 80px;
    gap: 8px;
    padding-top: var(--spacing-sm);
}

.precip-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.precip-bar {
    width: 100%;
    max-width: 36px;
    background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

.precip-day {
    font-size: 10px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.precip-value {
    font-size: 10px;
    color: var(--color-text-primary);
    font-weight: 500;
}

/* Hourly Forecast - Redesigned */
.hourly-section {
    background: var(--color-card-bg);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.hourly-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hourly-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hourly-header h3 i {
    color: #8b5cf6;
}

.hourly-scroll {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: var(--spacing-md) var(--spacing-lg);
    scroll-snap-type: x mandatory;
}

.hourly-scroll::-webkit-scrollbar {
    height: 6px;
}

.hourly-scroll::-webkit-scrollbar-track {
    background: var(--color-bg-tertiary);
}

.hourly-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.hourly-item {
    flex: 0 0 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-xs);
    border-radius: 10px;
    scroll-snap-align: start;
    transition: background 0.2s;
}

.hourly-item:hover {
    background: var(--color-hover-bg);
}

.hourly-item.now {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.hourly-time {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.hourly-item.now .hourly-time {
    color: #8b5cf6;
    font-weight: 600;
}

.hourly-icon {
    font-size: 22px;
    margin: 8px 0;
    color: #f59e0b;
}

.hourly-temp {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.hourly-precip {
    font-size: 10px;
    color: #06b6d4;
    margin-top: 4px;
}

/* Daily Forecast - Redesigned */
.forecast-section {
    background: var(--color-card-bg);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.forecast-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.forecast-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.forecast-header h3 i {
    color: #ec4899;
}

.forecast-list {
    display: flex;
    flex-direction: column;
}

.forecast-day {
    display: grid;
    grid-template-columns: 130px 1fr 100px 60px;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}

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

.forecast-day:hover {
    background: var(--color-hover-bg);
}

.forecast-day.today {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.08) 0%, transparent 100%);
}

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

.forecast-day.today .forecast-day-name {
    color: #ec4899;
}

.forecast-day-date {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.forecast-condition {
    display: flex;
    align-items: center;
    gap: 12px;
}

.forecast-condition i {
    font-size: 28px;
    color: #f59e0b;
}

.forecast-condition span {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.forecast-temps {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forecast-temp-high {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.forecast-temp-low {
    font-size: 15px;
    color: var(--color-text-tertiary);
}

.forecast-temp-bar {
    flex: 1;
    height: 4px;
    background: var(--color-bg-tertiary);
    border-radius: 2px;
    position: relative;
    margin: 0 8px;
}

.forecast-temp-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #ef4444);
    border-radius: 2px;
}

.forecast-precip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.forecast-precip i {
    color: #06b6d4;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 1200px) {
    .weather-alerts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .weather-hero-content {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .weather-hero-right {
        align-items: flex-start;
        width: 100%;
    }
    
    .weather-quick-stats {
        width: 100%;
    }
    
    .weather-alerts-grid {
        grid-template-columns: 1fr;
    }
    
    .spray-factors {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .forecast-day {
        grid-template-columns: 100px 1fr 80px 50px;
    }
}

@media (max-width: 768px) {
    .weather-temp-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .weather-quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .forecast-day {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }
    
    .forecast-condition {
        grid-column: 1 / -1;
        order: -1;
    }
}
