/* ==============================
   MAIN WEATHER WIDGET
============================== */

#ghmw-weather-wrapper {
    color: #111827;
    padding: 24px;
    font-family: "Roboto", sans-serif;
    border: 1px solid #e5e7eb;
}

/* HEADER */

#ghmw-weather-wrapper .ghmw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#ghmw-weather-wrapper .ghmw-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* CURRENT WEATHER */

.ghmw-current-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ghmw-temp {
    font-size: 42px;
    font-weight: bold;
}

.ghmw-desc {
    margin-top: 5px;
    font-size: 16px;
    color: #000;
    font-weight: 600;
}

/* WEATHER ICON */

.ghmw-animated-icon {
    width: 60px;
    height: 60px;
    animation: ghmw-float 3s ease-in-out infinite;
    background: none !important;
    border-radius: 0 !important;
}

/* FORECAST */

.ghmw-forecast {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.ghmw-day {
    text-align: center;
    flex: 1;
}

.ghmw-day-name {
    font-size: 14px;
    margin-bottom: 5px;
    color: #000;
}

.ghmw-day img {
    width: 36px;
    height: 36px;
}

.ghmw-day-temp {
    margin-top: 5px;
    font-size: 14px;
}

/* FOOTER */

.ghmw-footer {
    margin-top: 20px;
    text-align: right;
}

.ghmw-footer a {
    font-size: 14px;
    text-decoration: none;
    color: #2563eb;
}

.ghmw-footer a:hover {
    text-decoration: underline;
}

/* WEATHER BACKGROUNDS */

#ghmw-weather-wrapper.ghmw-clear {
    background: linear-gradient(135deg, #fef9c3, #fde68a);
}

#ghmw-weather-wrapper.ghmw-clouds {
    background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
}

#ghmw-weather-wrapper.ghmw-rain {
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
    color: #fff;
}

#ghmw-weather-wrapper.ghmw-snow {
    background: linear-gradient(135deg, #f3f4f6, #d1d5db);
}

/* ANIMATION */

@keyframes ghmw-float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}


/* ==============================
   HEADER WEATHER
============================== */

.ghmw-header-weather {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
}

.ghmw-header-weather img {
    width: 30px;
    height: 30px;
}

#ghmw-header-temp {
    font-weight: 600;
}

/* ==============================
   LOADING / ERROR STATES
============================== */

#ghmw-weather-wrapper.ghmw-loading,
#ghmw-weather-wrapper.ghmw-error {
    background: #f9fafb;
}

.ghmw-status {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    font-size: 15px;
    color: #4b5563;
}

.ghmw-status a {
    color: #2563eb;
    text-decoration: underline;
}

.ghmw-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid #d1d5db;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ghmw-spin 0.8s linear infinite;
}

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

/* Reserve the header widget's footprint so filling it in shifts nothing */

.ghmw-header-weather {
    min-height: 30px;
}

.ghmw-header-weather.ghmw-loading .ghmw-header-city {
    opacity: 0.6;
}

.ghmw-header-weather.ghmw-error {
    display: none;
}

@media (prefers-reduced-motion: reduce) {

    .ghmw-spinner {
        animation: none;
    }

    .ghmw-animated-icon {
        animation: none;
    }
}
