/* =============================================================
   FintechNewsPH — Weather Widget
   Displays current weather based on user geolocation.
   Placed alongside the date/time display in the search bar area.
   ============================================================= */

/* ---------- Widget Container ---------- */
.weather-widget {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--secondary-heading);
    font-size: 13px;
    color: var(--night-grey);
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 84, 161, 0.06);
    border: 1px solid rgba(0, 84, 161, 0.1);
    transition: background 0.25s ease, border-color 0.25s ease;
    line-height: 1.4;
}

.weather-widget:hover {
    background: rgba(0, 84, 161, 0.1);
    border-color: rgba(0, 84, 161, 0.18);
}

/* ---------- Content (visible once loaded) ---------- */
.weather-widget__content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Weather Icon ---------- */
.weather-widget__icon-img {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.weather-widget__icon {
    font-size: 16px;
    vertical-align: middle;
    color: var(--blue-light);
}

/* ---------- Temperature ---------- */
.weather-widget__temp {
    font-weight: 700;
    font-size: 14px;
    color: var(--blue-dark);
}

/* ---------- Description ---------- */
.weather-widget__desc {
    font-size: 12px;
    color: #555;
    text-transform: capitalize;
}

/* ---------- Separator ---------- */
.weather-widget__sep {
    color: #ccc;
    font-size: 12px;
    margin: 0 2px;
}

/* ---------- Location ---------- */
.weather-widget__location {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #666;
}

.weather-widget__location .material-symbols-outlined {
    font-size: 14px;
    color: var(--blue-light);
}

/* ---------- Loading State ---------- */
.weather-widget__loading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #999;
    font-size: 12px;
}

.weather-widget__loading .weather-widget__icon {
    animation: weather-pulse 1.5s ease-in-out infinite;
    color: #999;
}

@keyframes weather-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

/* ---------- Error State ---------- */
.weather-widget__error {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #999;
    font-size: 12px;
}

.weather-widget__error .weather-widget__icon {
    color: #bbb;
}

/* ---------- Dark Mode ---------- */
body.dark-mode .weather-widget {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .weather-widget:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

body.dark-mode .weather-widget__temp {
    color: #7cb8ff;
}

body.dark-mode .weather-widget__desc {
    color: #aaa;
}

body.dark-mode .weather-widget__sep {
    color: #555;
}

body.dark-mode .weather-widget__location {
    color: #999;
}

body.dark-mode .weather-widget__location .material-symbols-outlined {
    color: #7cb8ff;
}

body.dark-mode .weather-widget__loading,
body.dark-mode .weather-widget__error {
    color: #777;
}

body.dark-mode .weather-widget__error .weather-widget__icon,
body.dark-mode .weather-widget__loading .weather-widget__icon {
    color: #666;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .weather-widget {
        font-size: 11px;
        padding: 3px 8px;
        gap: 4px;
    }

    .weather-widget__temp {
        font-size: 12px;
    }

    .weather-widget__desc {
        display: none; /* hide description on small screens */
    }

    .weather-widget__sep {
        display: none;
    }

    .weather-widget__icon-img {
        font-size: 15px;
    }

    .weather-widget__location {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .weather-widget {
        font-size: 10px;
        padding: 2px 6px;
    }

    .weather-widget__location span:not(.material-symbols-outlined) {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
