/* ==========================================================
   MLT Weather Widget — Scoped Styles
   All classes prefixed with mlt-weather- to avoid conflicts
   ========================================================== */

/* ── Base wrapper ── */
.mlt-weather-wrap {
    --mlt-w-accent: #418E5B;
    --mlt-w-radius: 16px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0 auto;
    border-radius: var(--mlt-w-radius);
    overflow: hidden;
    padding: 28px;
    line-height: 1.4;
    box-sizing: border-box;
}

.mlt-weather-wrap *, .mlt-weather-wrap *::before, .mlt-weather-wrap *::after {
    box-sizing: border-box;
}

/* ── Dark theme ── */
.mlt-weather-wrap[data-theme="dark"] {
    --mlt-w-bg: #151b28;
    --mlt-w-card: #1e2536;
    --mlt-w-text: #eef0f6;
    --mlt-w-muted: #8892a8;
    --mlt-w-border: rgba(255,255,255,0.07);
    --mlt-w-hover: rgba(255,255,255,0.05);
    background: var(--mlt-w-bg);
    color: var(--mlt-w-text);
}

/* ── Light theme ── */
.mlt-weather-wrap[data-theme="light"] {
    --mlt-w-bg: #f4f6fa;
    --mlt-w-card: #ffffff;
    --mlt-w-text: #1a1f2e;
    --mlt-w-muted: #6b7280;
    --mlt-w-border: rgba(0,0,0,0.07);
    --mlt-w-hover: rgba(0,0,0,0.04);
    background: var(--mlt-w-bg);
    color: var(--mlt-w-text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Loader ── */
.mlt-weather-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 220px;
    color: var(--mlt-w-muted);
    font-size: 14px;
}

.mlt-weather-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--mlt-w-border);
    border-top-color: var(--mlt-w-accent);
    border-radius: 50%;
    animation: mlt-weather-spin 0.7s linear infinite;
}

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

/* ── Current weather ── */
.mlt-weather-current {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.mlt-weather-current__location {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.mlt-weather-current__temp {
    font-size: 52px;
    font-weight: 200;
    line-height: 1;
    letter-spacing: -2px;
    margin-bottom: 6px;
}

.mlt-weather-current__desc {
    font-size: 14px;
    color: var(--mlt-w-muted);
    text-transform: capitalize;
    margin-bottom: 10px;
}

.mlt-weather-current__hilo {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--mlt-w-muted);
}

.mlt-weather-current__high::before {
    content: '▲ ';
    font-size: 9px;
    color: var(--mlt-w-accent);
    vertical-align: middle;
}

.mlt-weather-current__low::before {
    content: '▼ ';
    font-size: 9px;
    color: #6b9ddb;
    vertical-align: middle;
}

.mlt-weather-current__icon {
    flex-shrink: 0;
}

.mlt-weather-current__icon svg {
    width: 76px;
    height: 76px;
}

/* ── Divider ── */
.mlt-weather-divider {
    height: 1px;
    background: var(--mlt-w-border);
    margin: 20px 0;
}

/* ── Section title ── */
.mlt-weather-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--mlt-w-muted);
    font-weight: 700;
    margin-bottom: 14px;
}

/* ── Hourly forecast ── */
.mlt-weather-hourly__list {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--mlt-w-accent) transparent;
}

.mlt-weather-hourly__list::-webkit-scrollbar {
    height: 3px;
}
.mlt-weather-hourly__list::-webkit-scrollbar-thumb {
    background: var(--mlt-w-accent);
    border-radius: 3px;
}

.mlt-weather-hourly__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    min-width: 60px;
    flex-shrink: 0;
    transition: background 0.2s ease;
    cursor: default;
}

.mlt-weather-hourly__item:hover {
    background: var(--mlt-w-hover);
}

.mlt-weather-hourly__item--now {
    background: var(--mlt-w-accent) !important;
    color: #fff !important;
}

.mlt-weather-hourly__item--now .mlt-weather-hourly__time {
    color: rgba(255,255,255,0.75) !important;
}

.mlt-weather-hourly__time {
    font-size: 11px;
    color: var(--mlt-w-muted);
    font-weight: 500;
}

.mlt-weather-hourly__icon svg {
    width: 22px;
    height: 22px;
}

.mlt-weather-hourly__temp {
    font-size: 13px;
    font-weight: 600;
}

/* ── Daily forecast ── */
.mlt-weather-daily__list {
    display: flex;
    flex-direction: column;
}

.mlt-weather-daily__item {
    display: flex;
    align-items: center;
    padding: 10px 6px;
    border-bottom: 1px solid var(--mlt-w-border);
    transition: background 0.2s ease;
    cursor: default;
}

.mlt-weather-daily__item:last-child {
    border-bottom: none;
}

.mlt-weather-daily__item:hover {
    background: var(--mlt-w-hover);
    border-radius: 8px;
}

.mlt-weather-daily__day {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.mlt-weather-daily__desc {
    flex: 1.2;
    font-size: 12px;
    color: var(--mlt-w-muted);
    text-transform: capitalize;
}

.mlt-weather-daily__icon {
    flex: 0 0 36px;
    display: flex;
    justify-content: center;
}

.mlt-weather-daily__icon svg {
    width: 22px;
    height: 22px;
}

.mlt-weather-daily__temps {
    flex: 0 0 90px;
    text-align: right;
    font-size: 14px;
    white-space: nowrap;
}

.mlt-weather-daily__high {
    font-weight: 600;
}

.mlt-weather-daily__low {
    color: var(--mlt-w-muted);
    margin-left: 8px;
}

/* ── Error state ── */
.mlt-weather-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 200px;
    color: var(--mlt-w-muted);
    font-size: 14px;
}

.mlt-weather-error__icon {
    font-size: 28px;
}

/* ── Fade-in animation ── */
.mlt-weather-content {
    animation: mlt-weather-fadeIn 0.5s ease-out;
}

@keyframes mlt-weather-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .mlt-weather-wrap { padding: 18px; }
    .mlt-weather-current__temp { font-size: 42px; }
    .mlt-weather-current__icon svg { width: 56px; height: 56px; }
    .mlt-weather-daily__desc { display: none; }
}
