/* ===== Roeya TV - Weather Popup Modal Styles ===== */

#roeya-weather-widget {
    cursor: pointer !important;
    user-select: none;
}
#roeya-weather-widget:hover {
    background: #ebeef2 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
#sidebar-weather-widget {
    cursor: pointer !important;
}
#sidebar-weather-widget:hover {
    background: #f0f4f0 !important;
}

/* Modal Overlay Backdrop */
#roeya-weather-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#roeya-weather-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal Dialog Card */
#roeya-weather-modal {
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    background: linear-gradient(165deg, #2d7fe0 0%, #43a4e5 40%, #2fb38d 100%);
    border-radius: 26px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    overflow-y: auto;
    overflow-x: hidden;
    color: #ffffff;
    position: relative;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

#roeya-weather-modal::-webkit-scrollbar {
    width: 6px;
}
#roeya-weather-modal::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

#roeya-weather-overlay.active #roeya-weather-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header: Search & Close */
.rwm-top-bar {
    padding: 16px 18px 8px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(45, 127, 224, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.rwm-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    width: 100%;
}

.rwm-search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.rwm-search-submit-btn {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 5;
}
.rwm-search-submit-btn:hover {
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}
[dir="rtl"] .rwm-search-submit-btn {
    left: auto;
    right: 4px;
}

.rwm-search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 5;
}
.rwm-search-clear-btn:hover {
    color: #fff;
}
[dir="rtl"] .rwm-search-clear-btn {
    right: auto;
    left: 10px;
}

.rwm-search-input {
    width: 100%;
    padding: 10px 34px 10px 36px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 22px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}
[dir="rtl"] .rwm-search-input {
    padding: 10px 36px 10px 34px;
}

.rwm-search-input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.rwm-search-input:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.rwm-location-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.rwm-location-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #ffd166;
    transform: scale(1.08);
}
.rwm-location-btn:active {
    transform: scale(0.95);
}
.rwm-location-btn.loading i {
    animation: rwmSpin 0.75s linear infinite;
    color: #ffd166;
}
.rwm-location-btn.has-custom-city {
    background: rgba(255, 209, 102, 0.3);
    border: 1px solid rgba(255, 209, 102, 0.55);
    color: #ffd166;
}
.rwm-location-btn.has-custom-city:hover {
    background: rgba(255, 209, 102, 0.45);
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.rwm-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.rwm-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

.rwm-my-location-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(56, 239, 125, 0.25);
    border: 1px solid rgba(56, 239, 125, 0.6);
    color: #38ef7d;
    font-size: 10px;
    margin-left: 6px;
    vertical-align: middle;
    animation: rwmPulse 2.5s infinite;
}
[dir="rtl"] .rwm-my-location-badge {
    margin-left: 0;
    margin-right: 6px;
}
@keyframes rwmPulse {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}

/* Search Dropdown Results */
.rwm-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0,0,0,0.35);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    color: #1a1a1a;
    border: 1px solid rgba(0,0,0,0.08);
}

.rwm-search-result-item {
    padding: 11px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 500;
    border-bottom: 1px solid #f1f2f4;
    transition: background 0.15s, color 0.15s;
    color: #1f2937;
}
.rwm-search-result-item:last-child {
    border-bottom: none;
}
.rwm-search-result-item:hover {
    background: #f0fdf4;
    color: #16a34a;
}
.rwm-search-loading, .rwm-search-empty {
    padding: 14px 16px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

/* Hero Section */
.rwm-hero {
    text-align: center;
    padding: 24px 20px 18px;
}

.rwm-city-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.rwm-main-temp {
    font-size: 68px;
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -2px;
    margin: 6px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.rwm-condition {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.rwm-details {
    font-size: 13.5px;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.2px;
}

/* Glass Card Containers inside Modal */
.rwm-card {
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    margin: 12px 16px;
    padding: 14px 16px;
}

.rwm-card-header {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Hourly Horizontal Scroll */
.rwm-hourly-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.rwm-hourly-track::-webkit-scrollbar {
    height: 4px;
}
.rwm-hourly-track::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.rwm-hour-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 48px;
    font-size: 12px;
}
.rwm-hour-time {
    opacity: 0.85;
    font-weight: 500;
    font-size: 11.5px;
}
.rwm-hour-icon {
    font-size: 20px;
    line-height: 1;
}
.rwm-hour-temp {
    font-weight: 700;
    font-size: 13.5px;
}
.rwm-hour-pop {
    font-size: 10.5px;
    opacity: 0.9;
    color: #e0f2fe;
    font-weight: 600;
}

/* Sunset / Sun Info Card */
.rwm-sun-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rwm-sun-text {
    font-size: 13px;
    font-weight: 500;
}
.rwm-sun-text strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-top: 2px;
}
.rwm-sun-icon {
    font-size: 32px;
}

/* 7-Day Forecast Rows */
.rwm-daily-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rwm-daily-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 500;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rwm-daily-row:last-child {
    border-bottom: none;
}

.rwm-daily-day {
    width: 90px;
    font-weight: 600;
}

.rwm-daily-pop {
    width: 48px;
    font-size: 11.5px;
    color: #e0f2fe;
    font-weight: 600;
    text-align: center;
}

.rwm-daily-icon {
    font-size: 18px;
    width: 32px;
    text-align: center;
}

.rwm-daily-temps {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 120px;
    justify-content: flex-end;
}
.rwm-temp-min {
    opacity: 0.7;
    font-size: 12.5px;
}
.rwm-temp-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.rwm-temp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #93c5fd, #fde047);
    border-radius: 2px;
}
.rwm-temp-max {
    font-weight: 700;
    font-size: 13.5px;
}

/* Shimmer Loading State */
.rwm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 14px;
}
.rwm-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: rwmSpin 0.8s linear infinite;
}
@keyframes rwmSpin {
    to { transform: rotate(360deg); }
}

/* RTL Specific Rules for Weather Modal Search */
[dir="rtl"] .rwm-search-result-item {
    text-align: right;
    direction: rtl;
}
[dir="rtl"] .rwm-search-result-item i {
    margin-right: 0 !important;
    margin-left: 6px !important;
}
[dir="rtl"] .rwm-search-box .rwm-search-input {
    text-align: right;
}

