/* ============================================
   VEYA Weather™ — Styles
   Uses TARVEYA CSS variables
   ============================================ */

/* Hero */
.weather-hero {
    background: linear-gradient(135deg, var(--deep-ocean, #1a365d) 0%, var(--sunset-coral, #e76f51) 100%);
    padding: 2.5rem 0 2rem;
    color: #fff;
    text-align: center;
}

.weather-hero h1,
.weather-hero h2,
.weather-hero h3,
.weather-hero h4,
.weather-hero p,
.weather-hero span,
.weather-hero label {
    color: #fff !important;
}

.weather-hero-title {
    margin-bottom: 1.5rem;
}

.weather-brand {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: var(--font-heading-en, 'Playfair Display', serif) !important;
    color: #fff !important;
    direction: ltr;
    unicode-bidi: isolate;
}

.weather-subtitle {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 0.25rem;
    color: rgba(255,255,255,0.85) !important;
}

.weather-search-bar {
    max-width: 600px;
    margin: 0 auto;
}

.weather-search-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.weather-city-select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

[dir="rtl"] .weather-city-select {
    background-position: left 1rem center;
    padding-right: 1rem;
    padding-left: 2.5rem;
}

.weather-city-select option {
    color: #333;
    background: #fff;
}

.weather-city-select:focus {
    outline: none;
    border-color: var(--golden-sand, #f4a261);
}

.weather-gps-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.weather-gps-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: var(--golden-sand, #f4a261);
}

/* Loading */
.weather-loading {
    padding: 4rem 0;
    text-align: center;
}

.weather-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.weather-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top-color: var(--sunset-coral, #e76f51);
    border-radius: 50%;
    animation: weatherSpin 0.8s linear infinite;
}

@keyframes weatherSpin {
    to { transform: rotate(360deg); }
}

.weather-loader p {
    color: var(--text-muted, #6b7280);
    font-size: 1rem;
}

/* Empty */
.weather-empty {
    padding: 4rem 0;
    text-align: center;
}

.weather-empty-content {
    max-width: 400px;
    margin: 0 auto;
}

.weather-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.weather-empty h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #1f2937);
}

.weather-empty p {
    color: var(--text-muted, #6b7280);
}

/* Main Content */
.weather-content {
    padding: 2rem 0 3rem;
}

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

.weather-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary, #1f2937);
}

.section-icon {
    font-size: 1.3rem;
}

/* Current Weather Card */
.weather-current-card {
    background: linear-gradient(135deg, var(--deep-ocean, #1a365d) 0%, #2563eb 100%);
    border-radius: 20px;
    padding: 2rem;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.weather-current-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.weather-current-icon {
    font-size: 4rem;
    line-height: 1;
}

.weather-current-temp {
    display: flex;
    align-items: flex-start;
}

.temp-value {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.temp-unit {
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255,255,255,0.7);
    margin-top: 0.5rem;
}

.weather-current-info {
    flex: 1;
    min-width: 150px;
}

.current-city-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #fff;
}

.current-desc {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.25rem;
}

.current-feels {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.weather-current-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.weather-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.detail-icon {
    font-size: 1.25rem;
}

.detail-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

/* Alerts */
.weather-alerts-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.weather-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.weather-alert.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.weather-alert.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.weather-alert.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #2563eb;
}

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

/* Hourly Forecast */
.weather-hourly-wrapper {
    position: relative;
}

.weather-hourly-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.5rem 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.weather-hourly-scroll::-webkit-scrollbar {
    display: none;
}

.hourly-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1f2937);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.hourly-scroll-btn:hover {
    background: var(--sunset-coral, #e76f51);
    color: #fff;
    border-color: var(--sunset-coral, #e76f51);
}

.hourly-scroll-prev {
    left: -18px;
}

.hourly-scroll-next {
    right: -18px;
}

[dir="rtl"] .hourly-scroll-prev {
    left: auto;
    right: -18px;
}

[dir="rtl"] .hourly-scroll-next {
    right: auto;
    left: -18px;
}

.weather-hour-card {
    flex: 0 0 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.875rem 0.5rem;
    border-radius: 14px;
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    text-align: center;
    transition: all 0.2s;
}

.weather-hour-card:hover {
    border-color: var(--sunset-coral, #e76f51);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.hour-time {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    font-weight: 500;
}

.hour-icon {
    font-size: 1.5rem;
}

.hour-temp {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
}

.hour-precip {
    font-size: 0.7rem;
    color: #3b82f6;
}

/* Daily Forecast */
.weather-daily-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-day-row {
    display: grid;
    grid-template-columns: 100px 40px 1fr 80px 60px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    transition: all 0.2s;
}

.weather-day-row:hover {
    border-color: var(--sunset-coral, #e76f51);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.day-name {
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    font-size: 0.95rem;
}

.day-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    font-weight: 400;
}

.day-icon {
    font-size: 1.5rem;
    text-align: center;
}

.day-desc {
    color: var(--text-secondary, #4b5563);
    font-size: 0.9rem;
}

.day-temps {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-weight: 600;
    white-space: nowrap;
}

.day-temp-max {
    color: var(--sunset-coral, #e76f51);
}

.day-temp-min {
    color: #3b82f6;
    opacity: 0.7;
}

.day-precip {
    font-size: 0.8rem;
    color: #3b82f6;
    text-align: center;
}

/* Two Columns */
.weather-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Air Quality */
.weather-air-container {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    padding: 1.5rem;
}

.aqi-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.aqi-badge {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.aqi-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.aqi-info p {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
}

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

.aqi-pollutant {
    text-align: center;
    padding: 0.5rem;
    border-radius: 10px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
}

.aqi-pollutant-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.aqi-pollutant-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
}

.aqi-pollutant-value small {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-muted, #9ca3af);
}

.aqi-pollutant-name {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted, #9ca3af);
    margin-top: 2px;
}

.aqi-pollutant-high {
    border-color: rgba(239, 68, 68, 0.2) !important;
    background: rgba(239, 68, 68, 0.03);
}

.aqi-description {
    font-size: 0.82rem;
    color: var(--text-secondary, #4b5563);
    text-align: center;
    padding: 8px 16px 16px;
    line-height: 1.6;
}

.aqi-uv-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    margin: 12px 16px 0;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 10px;
}

.aqi-health-tip {
    padding: 12px 16px;
    margin: 10px 16px 0;
    background: rgba(245, 158, 11, 0.06);
    border-radius: 10px;
    border-inline-start: 3px solid #f59e0b;
}

/* Travel Advice */
.weather-advice-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aqi-dust-section,
.aqi-aod-section,
.aqi-pollen-section {
    padding: 14px 16px;
    margin: 8px 16px 0;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 12px;
}

.aqi-source {
    padding: 12px 16px;
    margin-top: 12px;
    border-top: 1px solid var(--border-light, #e5e7eb);
}

.advice-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
}

/* V2 Advice Cards */
.advice-item-v2 {
    padding: 14px 16px;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.advice-item-v2:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.advice-item-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.advice-icon-v2 {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.advice-text-v2 {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.6;
}

.advice-link-v2 {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(0,0,0,0.04);
    transition: background 0.2s;
}
.advice-link-v2:hover {
    background: rgba(0,0,0,0.08);
}

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

/* Weather Map */
.weather-map-container {
    height: 350px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ============================================
   Dark Mode
   ============================================ */
[data-theme="dark"] .weather-current-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

[data-theme="dark"] .weather-hour-card,
[data-theme="dark"] .weather-day-row,
[data-theme="dark"] .weather-air-container,
[data-theme="dark"] .advice-item {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .weather-alert.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .weather-alert.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .weather-alert.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

[data-theme="dark"] .hourly-scroll-btn {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-color, #334155);
    color: #e2e8f0;
}

[data-theme="dark"] .aqi-pollutant {
    background: rgba(255,255,255,0.05);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .weather-empty h2,
[data-theme="dark"] .hour-temp,
[data-theme="dark"] .day-name {
    color: #e2e8f0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .weather-hero {
        padding: 1.5rem 0;
    }

    .weather-brand {
        font-size: 1.5rem;
    }

    .weather-search-wrapper {
        flex-direction: column;
    }

    .weather-gps-btn {
        width: 100%;
        justify-content: center;
    }

    .weather-current-main {
        flex-direction: column;
        text-align: center;
    }

    .weather-current-details {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .weather-day-row {
        grid-template-columns: 80px 32px 1fr 70px;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .day-precip {
        display: none;
    }

    .hourly-scroll-prev,
    .hourly-scroll-next {
        display: none;
    }

    .weather-map-container {
        height: 250px;
    }

    .temp-value {
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    .weather-current-details {
        grid-template-columns: repeat(2, 1fr);
    }
}
