/**
 * Weather Widget Styles - Saudi Cultural Design
 * Vision 2030 Lavender + Warm Beige/Cream Theme
 * Supports light/dark themes and RTL
 */

.weather-widget {
    background: linear-gradient(135deg, #A78BBA 0%, #E8D5C4 100%);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(167, 139, 186, 0.15), 0 2px 6px rgba(130, 38, 89, 0.12);
    transition: all 0.3s ease;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(167, 139, 186, 0.2);
    max-width: 100%;
}

/* Saudi Cultural Accent Line - Gold + Lavender */
.weather-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FFD700 0%, #A78BBA 50%, #FFD700 100%);
}

.weather-widget:hover {
    box-shadow: 0 6px 16px rgba(167, 139, 186, 0.25), 0 3px 8px rgba(130, 38, 89, 0.15);
    transform: translateY(-2px);
}

/* Dark theme support */
[data-theme="dark"] .weather-widget {
    background: linear-gradient(135deg, rgba(167, 139, 186, 0.3) 0%, rgba(26, 26, 26, 0.9) 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(167, 139, 186, 0.3);
}

[data-theme="dark"] .weather-widget:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Compact Header */
.weather-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.weather-city-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weather-city-name h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .weather-city-name h3 {
    color: #F0F0F0;
}

.weather-icon-location {
    color: #FFD700;
    font-size: 1.25rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* City Icon - Weather Icon */
.weather-city-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.weather-city-icon-img {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.weather-mock-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background-color: #FFD700;
    color: #1A1A1A;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 12px;
    margin-left: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.weather-widget[dir="rtl"] .weather-mock-badge {
    margin-left: 0;
    margin-right: 0.5rem;
}

.weather-expand-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.weather-expand-btn:hover {
    background-color: rgba(255, 255, 255, 0.35);
    border-color: #FFD700;
    transform: scale(1.1);
}

[data-theme="dark"] .weather-expand-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.weather-expand-btn .material-symbols-outlined {
    color: #FFFFFF;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Compact Current Weather */
.weather-current {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

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

.weather-icon-container {
    flex-shrink: 0;
}

.weather-icon-main {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

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

.weather-temp-value {
    font-size: 2.5rem;
    font-weight: 300;
    color: #FFFFFF;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .weather-temp-value {
    color: #F0F0F0;
}

.weather-temp-unit {
    font-size: 1.25rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

.weather-description {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.weather-description p {
    margin: 0;
    font-size: 0.875rem;
    color: #FFFFFF;
    text-transform: capitalize;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .weather-description p {
    color: #F0F0F0;
}

.weather-feels-like {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Weather Details */
.weather-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

[data-theme="dark"] .weather-details {
    border-top-color: rgba(255, 255, 255, 0.1);
}

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

.weather-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.weather-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    gap: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .weather-detail-item {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

.weather-detail-item .material-symbols-outlined {
    font-size: 1.75rem;
    color: #FFD700;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.weather-detail-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-detail-value {
    font-size: 1rem;
    color: #FFFFFF;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .weather-detail-value {
    color: #F0F0F0;
}

/* Sun Times */
.weather-sun-times {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-top: 1rem;
}

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

.weather-sun-item .material-symbols-outlined {
    font-size: 2.25rem;
    color: #FFD700;
    filter: drop-shadow(0 2px 6px rgba(255, 215, 0, 0.4));
}

.weather-sun-item span {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

.weather-sun-item span:last-child {
    font-weight: 700;
    color: #FFFFFF;
    font-size: 0.9375rem;
}

[data-theme="dark"] .weather-sun-item span:last-child {
    color: #F0F0F0;
}

/* Footer */
.weather-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

[data-theme="dark"] .weather-footer {
    border-top-color: rgba(255, 255, 255, 0.15);
}

.weather-footer small {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* Loading State */
.weather-widget.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 1rem;
}

.weather-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(167, 139, 186, 0.2);
    border-top-color: #A78BBA;
    border-right-color: #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.weather-widget.loading p {
    margin: 0;
    color: var(--text-secondary, #666);
}

/* Error State */
.weather-widget.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    gap: 1rem;
}

.weather-widget.error p {
    margin: 0;
    color: var(--error, #d32f2f);
    font-weight: 500;
}

.weather-retry-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #006C35 0%, #008A42 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 108, 53, 0.3);
}

.weather-retry-btn:hover {
    background: linear-gradient(135deg, #008A42 0%, #006C35 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 108, 53, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .weather-widget {
        padding: 1rem;
    }

    .weather-city-name h3 {
        font-size: 1.125rem;
    }

    .weather-icon-main {
        width: 60px;
        height: 60px;
    }

    .weather-temp-value {
        font-size: 2.5rem;
    }

    .weather-temp-unit {
        font-size: 1.25rem;
    }

    .weather-detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .weather-detail-item {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .weather-widget {
        padding: 0.75rem;
    }

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

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

    .weather-sun-times {
        flex-direction: column;
    }
}

/* RTL Support */
.weather-widget[dir="rtl"] .weather-city-name {
    flex-direction: row-reverse;
}

.weather-widget[dir="rtl"] .weather-main {
    flex-direction: row-reverse;
}

.weather-widget[dir="rtl"] .weather-temp {
    flex-direction: row-reverse;
}

