/* ===== AL Weather — Calm Aurora (v2.2.0) ===== */
.alw-widget{
  --radius:16px; --pad:16px;
  --bg1:#bfe3ff; --bg2:#e3f2ff; /* Light Sky default (blu e lehtë); JS mund ta ndryshojë sipas motit */
  --glass:rgba(255,255,255,0.72);
  --fg:#0b2239; --muted:#5b6b7a; --border:rgba(0,0,0,0.08);
  position:relative; isolation:isolate; border-radius:var(--radius); overflow:hidden;
  color:var(--fg);
  box-shadow:0 12px 30px rgba(0,0,0,0.12);
}
@media (prefers-color-scheme:dark){
  .alw-widget{ --glass:rgba(16,20,26,0.66); --fg:#e8f2ff; --muted:#9fb0c0; --border:rgba(255,255,255,0.08); }
}
.alw-widget.alw-calm::before{
  content:""; position:absolute; inset:-20%; z-index:-1;
  background:linear-gradient(135deg, var(--bg1), var(--bg2));
  filter:blur(40px) saturate(120%);
  transform:scale(1.1);
}
.alw-widget.glass{ background:var(--glass); backdrop-filter:blur(10px); }
.alw-inner{ padding:var(--pad); max-width:980px; margin:0 auto; }

/* Hero */
.alw-hero{ display:flex; align-items:center; justify-content:space-between; gap:18px; }
.alw-place h2{ margin:0; font-size:26px; font-weight:700; letter-spacing:-0.01em; }
.alw-coords{ font-size:12px; color:var(--muted); margin-top:4px; }
.alw-now{ display:flex; align-items:center; gap:14px; }
.alw-temp{ font-size:56px; font-weight:800; letter-spacing:-0.02em; }
.alw-icon{ width:44px; height:44px; }
.alw-extras{ display:flex; gap:12px; color:var(--muted); font-size:12px; flex-wrap:wrap; }

/* Hourly scroller */
.alw-hourly{ display:flex; gap:10px; overflow:auto; padding:14px 0; scroll-snap-type:x mandatory; }
.alw-hour-card{ min-width:90px; scroll-snap-align:start; border:1px solid var(--border); border-radius:12px; padding:10px;
  text-align:center; background:rgba(255,255,255,0.42); }
@media (prefers-color-scheme:dark){
  .alw-hour-card{ background:rgba(255,255,255,0.06); }
}
.alw-hour-card .alw-h{ font-size:12px; color:var(--muted); margin-bottom:6px; }
.alw-hour-card .alw-t{ font-weight:700; margin-top:6px; }
.alw-hour-card .alw-p,.alw-hour-card .alw-w{ font-size:12px; color:var(--muted); }

/* Daily table */
.alw-daily{ width:100%; border-collapse:separate; border-spacing:0; margin-top:4px; }
.alw-daily thead th{ position:sticky; top:0; backdrop-filter:saturate(120%) blur(6px); background:rgba(255,255,255,0.55); text-align:left; font-size:12px; color:var(--muted); padding:10px; }
@media (prefers-color-scheme:dark){
  .alw-daily thead th{ background:rgba(16,20,26,0.55); }
}
.alw-daily td{ padding:12px 10px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:middle; }
.alw-daily tbody tr:hover{ background:rgba(255,255,255,0.25); }
@media (prefers-color-scheme:dark){
  .alw-daily tbody tr:hover{ background:rgba(255,255,255,0.05); }
}

/* Headline above SSR */
.alw-headline{ margin:0 0 10px 0; font-size:28px; line-height:1.2; letter-spacing:-0.01em; }

/* Skeleton for JS-driven widgets */
.alw-skel{ display:grid; grid-template-columns:1fr auto; gap:16px; padding:var(--pad); }
.alw-skel .bar{ height:14px; border-radius:8px; background:linear-gradient(90deg, rgba(255,255,255,0.35), rgba(255,255,255,0.6), rgba(255,255,255,0.35)); animation:alw-shimmer 1.35s infinite; }
.alw-skel .big{ height:48px; width:120px; }
.alw-skel .chip{ width:80px; height:18px; border-radius:9px; }
@keyframes alw-shimmer{ 0%{background-position:-200px 0}100%{background-position:200px 0} }

/* Mobile */
@media (max-width: 640px){
  .alw-inner{ padding:12px; }
  .alw-place h2{ font-size:20px; }
  .alw-temp{ font-size:44px; }
  .alw-icon{ width:36px; height:36px; }
}

/* Utility states */
.alw-error{ padding:var(--pad); color:#b00020; font-size:14px; }

/* Hide wind on mobile option */
@media (max-width: 640px){
  .alw-hide-wind-mobile .alw-hour-card .alw-w{ display:none; }
  .alw-hide-wind-mobile .alw-extras .alw-wind{ display:none; }
  .alw-hide-wind-mobile .alw-daily th:nth-child(4),
  .alw-hide-wind-mobile .alw-daily td:nth-child(4){ display:none; }
}

/* Narrower Temp column */
.alw-daily th.alw-col-temp,
.alw-daily td.alw-col-temp{
  width: 7.5rem;        /* ~120px desktop */
  max-width: 7.5rem;
  white-space: nowrap;
  text-align: center;
}
@media (max-width: 860px){
  .alw-daily th.alw-col-temp,
  .alw-daily td.alw-col-temp{ width: 6.25rem; max-width: 6.25rem; } /* ~100px */
}
@media (max-width: 640px){
  .alw-daily th.alw-col-temp,
  .alw-daily td.alw-col-temp{ width: 5.5rem; max-width: 5.5rem; }   /* ~88px */
}


/* === ALW Search === */
.alw-search{ width:100%; margin:8px 0 14px; }
.alw-search-wrap{ position:relative; }
.alw-search-input{
  width:100%; border:1px solid var(--border); border-radius:14px; padding:12px 42px 12px 14px;
  font-size:14px; background:rgba(255,255,255,0.68);
}
@media (prefers-color-scheme:dark){ .alw-search-input{ background:rgba(0,0,0,0.22); color:var(--fg); } }
.alw-search-btn{
  position:absolute; right:6px; top:6px; height:32px; width:36px; border-radius:10px; border:1px solid var(--border);
  background:rgba(255,255,255,0.7); cursor:pointer;
}
@media (prefers-color-scheme:dark){ .alw-search-btn{ background:rgba(255,255,255,0.06); color:var(--fg); } }
.alw-autocomplete{
  position:absolute; left:0; right:0; margin-top:6px; z-index:30; border:1px solid var(--border);
  background:rgba(255,255,255,0.9); backdrop-filter:blur(10px); border-radius:12px; overflow:hidden;
}
@media (prefers-color-scheme:dark){ .alw-autocomplete{ background:rgba(15,20,26,0.85); } }
.alw-ac-item{ padding:10px 12px; display:flex; flex-direction:column; gap:2px; cursor:pointer; }
.alw-ac-item .t{ font-weight:700; }
.alw-ac-item .s{ font-size:12px; color:var(--muted); }
.alw-ac-item:hover, .alw-ac-item.is-active{ background:rgba(255,255,255,0.35); }
@media (prefers-color-scheme:dark){ .alw-ac-item:hover, .alw-ac-item.is-active{ background:rgba(255,255,255,0.06); } }


/* --- Auto-contrast overrides (light/dark) --- */
.alw-widget[data-contrast="dark"]{ --fg:#f4f9ff; --muted:rgba(235,245,255,0.78); --border:rgba(255,255,255,0.18); --glass:rgba(255,255,255,0.08); }
.alw-widget[data-contrast="light"]{ --fg:#0b2239; --muted:#5b6b7a; --border:rgba(0,0,0,0.08); --glass:rgba(255,255,255,0.72); }
.alw-widget a, .alw-widget button, .alw-widget .btn { color: var(--fg); }


/* === Mobile Card layout for 10-day (.alw-daily) === */
@media (max-width: 640px){
  .alw-daily thead{ display:none; }
  .alw-daily{ border-collapse:separate; border-spacing:0 10px; }
  .alw-daily tbody tr{ display:grid; grid-template-columns:minmax(120px,1fr) 28px 64px 96px; gap:8px 12px; align-items:center; background:var(--glass); border:1px solid var(--border); border-radius:14px; padding:10px 12px; }
  .alw-daily tbody td{ border:0; padding:4px 6px; }
  .alw-daily tbody td:nth-child(4){ display:none; } /* hide wind in mobile */
  .alw-daily tbody td:nth-child(3){ grid-column:2; text-align:center; }
  .alw-daily tbody td:nth-child(5){ grid-column:3; text-align:center; white-space:nowrap; }
  .alw-daily tbody td:nth-child(2){ grid-column:4; text-align:right; font-weight:700; white-space:nowrap; }
  .alw-daily img.alw-icon{ width:24px; height:24px; }
  .alw-daily{ font-variant-numeric: tabular-nums; }
}


/* Mobile daily row polish */
@media (max-width: 640px){
  .alw-daily tbody td, .alw-daily tbody td *{ background: transparent !important; box-shadow: none !important; text-shadow: none !important; filter: none !important; }
}


/* Deep Blue fallback in CSS (mobile) */
@media (max-width: 640px){
  .alw-widget{ --bg1:#0f2c82; --bg2:#091a4b; --fg:#f4f9ff; --muted:rgba(235,245,255,.78); --border:rgba(255,255,255,.14); --glass:rgba(255,255,255,.08); }
}


/* Split day/date styling */
.alw-daily tbody td:first-child .alw-dow{ font-weight:700; }
.alw-daily tbody td:first-child .alw-date{ opacity:.9; }


/* === Mobile daily row: vertical align consistent + bigger icon === */
.alw-daily td{ vertical-align: middle; } /* desktop/table fallback */

@media (max-width: 640px){
  .alw-daily tbody td{ display:flex; align-items:center; line-height:1.25; padding-top:6px; padding-bottom:6px; }
  .alw-daily tbody td:nth-child(1){ align-items:center; } /* day/date stacked, centered */
  .alw-daily tbody td:nth-child(3){ justify-content:center; }  /* icon cell */
  .alw-daily tbody td:nth-child(5){ justify-content:center; }  /* precip mm */
  .alw-daily tbody td:nth-child(2){ justify-content:flex-end; }/* temp */

  .alw-daily tbody img.alw-icon{ width:32px; height:32px; flex:0 0 32px; display:block; }
}

/* === AI Paragraph styles === */
.alw-ai-heading{ margin: 14px 0 8px; font-size: 18px; font-weight: 800; color: var(--fg); }
.alw-ai-area{ background: var(--glass); border:1px solid var(--border); border-radius:14px; padding:12px 14px; color: var(--fg); }
.alw-ai-area p{ margin:0; line-height:1.45; }


/* === Fix: keep day-of-week on one line; date below on one line; widen first col === */
.alw-daily tbody td:first-child .alw-dow{ display:block; white-space:nowrap; font-weight:700; line-height:1.12; }
.alw-daily tbody td:first-child .alw-date{ display:block; white-space:nowrap; line-height:1.06; }
@media (max-width: 640px){
  .alw-daily tbody tr{ grid-template-columns: minmax(150px,1fr) 32px 72px 104px; } /* widen day col */
  .alw-daily tbody img.alw-icon{ width:32px; height:32px; }
}


@media (max-width: 640px){
  .alw-daily tbody td:first-child{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
  }
}


/* === AI Curiosity card with orange border === */
.alw-ai-heading{ margin:16px 0 8px; font-size:18px; font-weight:800; color:var(--fg); }
.alw-ai-area{ background: var(--glass); border:1.5px solid #FFA23A; border-radius:14px; padding:12px 14px; color:var(--fg); }
.alw-ai-area p{ margin:0; line-height:1.45; }


/* === v2.2.40: tighter cards + bigger icons === */
@media (max-width: 640px){
  .alw-daily{ border-collapse:separate; border-spacing:0 6px; } /* was 10px */
  .alw-daily tbody tr{
    padding: 6px 10px;          /* was 10px 12px */
    gap: 6px 10px;              /* was 8px 12px */
  }
  .alw-daily tbody td{
    padding: 2px 4px;           /* was 4px 6px */
    line-height: 1.2;
  }
  .alw-daily tbody td *{ margin:0 !important; } /* kill theme margins */
  .alw-daily tbody td:first-child{
    display:flex; flex-direction:column; align-items:flex-start; row-gap:2px;
  }
  .alw-daily tbody img.alw-icon{ width:36px; height:36px; } /* bigger icon */
  /* keep straight line layout */
  .alw-daily tbody tr{ grid-template-columns: minmax(150px,1fr) 36px 68px 100px; }
}


/* === v2.2.41: fix large gap by constraining first column; remove hidden pseudo-elements; bigger icon 40px === */
@media (max-width: 640px){
  /* Constrain first column: clamp keeps it between 120–150px so it can't expand to 1fr */
  .alw-daily tbody tr{
    grid-template-columns: clamp(120px, 36%, 150px) 40px 70px 100px;
    align-items:center;
    gap:6px 8px;
  }
  /* Kill any ::before/::after overlays from themes/optimizers that could eat space */
  .alw-daily tbody tr::before,
  .alw-daily tbody tr::after,
  .alw-daily tbody td::before,
  .alw-daily tbody td::after{ content:none !important; display:none !important; }
  /* Larger weather icon */
  .alw-daily tbody img.alw-icon{ width:40px; height:40px; display:block; }
}


/* === v2.2.42: strict vertical centering for icon/mm/temp === */
@media (max-width: 640px){
  .alw-daily tbody tr{
    grid-template-columns: clamp(130px, 38%, 160px) 44px 72px 108px;
    align-items: center;        /* centers content in each grid cell */
    grid-auto-rows: minmax(54px, auto);
    gap: 6px 10px;
  }
  .alw-daily tbody td{ padding:6px 8px; }
  /* Day cell stays stacked, left-aligned */
  .alw-daily tbody td:first-child{
    display:flex; flex-direction:column; align-items:flex-start; row-gap:2px;
  }
  /* Icon / mm / temp cells: true middle align with flex */
  .alw-daily tbody td:nth-child(3),
  .alw-daily tbody td:nth-child(5),
  .alw-daily tbody td:nth-child(2){
    display:flex; align-items:center;
  }
  .alw-daily tbody td:nth-child(3){ justify-content:center; } /* icon */
  .alw-daily tbody td:nth-child(5){ justify-content:center; } /* mm */
  .alw-daily tbody td:nth-child(2){ justify-content:flex-end; } /* temp */
  .alw-daily tbody img.alw-icon{
    width:44px; height:44px; display:block; object-fit:contain;
    transform: translateY(-1px); /* tiny optical nudge */
  }
  .alw-daily tbody td *{ margin:0 !important; line-height:1.2; }
}


/* === v2.2.43: aggressive reset to remove invisible gaps & enforce alignment === */
.alw-daily, .alw-daily * { box-sizing: border-box; }
.alw-daily tbody td, .alw-daily tbody td *{
  margin:0 !important; border:0; background:transparent !important;
  box-shadow:none !important; text-shadow:none !important; outline:0;
}
.alw-daily tbody tr::before, .alw-daily tbody tr::after,
.alw-daily tbody td::before, .alw-daily tbody td::after{ content:none !important; display:none !important; }

@media (max-width: 640px){
  .alw-daily{ border-collapse:separate; border-spacing:0 6px; }
  .alw-daily tbody tr{
    display:grid;
    grid-template-columns: clamp(132px, 38%, 164px) 44px 76px 112px; /* day | icon | mm | temp */
    align-items:center; gap:6px 10px;
    padding:6px 10px; min-height:56px;
  }
  .alw-daily tbody td{ display:flex; align-items:center; padding:0 4px; line-height:1.2; }
  .alw-daily tbody td:first-child{
    flex-direction:column; align-items:flex-start; justify-content:center; row-gap:2px;
  }
  .alw-daily tbody td:nth-child(3){ justify-content:center; }   /* icon */
  .alw-daily tbody td:nth-child(5){ justify-content:center; white-space:nowrap; } /* mm */
  .alw-daily tbody td:nth-child(2){ justify-content:flex-end; white-space:nowrap; } /* temp */
  .alw-daily img.alw-icon{
    width:44px; height:44px; display:block; object-fit:contain; vertical-align:middle; transform:translateY(-1px);
  }
  .alw-dow, .alw-date{ display:block; white-space:nowrap; line-height:1.1; }
  .alw-daily{ font-variant-numeric: tabular-nums; }
}


/* === v2.2.44: robust mapping via :has() and classes === */
@media (max-width: 640px){
  .alw-daily tbody tr{
    display:grid;
    grid-template-columns: clamp(130px,38%,160px) 44px 80px 116px; /* day | icon | mm | temp */
    align-items:center; gap:6px 10px; padding:6px 10px;
    min-height:56px;
  }
  .alw-daily tbody td{ display:flex; align-items:center; padding:0 4px; }
  .alw-daily tbody td:first-child{ flex-direction:column; align-items:flex-start; justify-content:center; row-gap:2px; }
  .alw-dow, .alw-date{ display:block; white-space:nowrap; line-height:1.08; }

  /* Map by meaning (robust to column order) */
  .alw-daily tbody td:has(img.alw-icon){ grid-column:2 !important; justify-content:center; }    /* icon */
  .alw-daily tbody td.alw-col-temp{ grid-column:4 !important; justify-content:flex-end; white-space:nowrap; font-weight:700; } /* temp */
  .alw-daily tbody td:last-child{ grid-column:3 !important; justify-content:center; white-space:nowrap; } /* precip mm is last cell */

  /* Fallback if :has() unsupported: keep previous nth-child mapping */
  .alw-daily tbody td:nth-child(3){ justify-content:center; }
  .alw-daily tbody td:nth-child(5){ justify-content:center; white-space:nowrap; }
  .alw-daily tbody td:nth-child(2){ justify-content:flex-end; white-space:nowrap; }

  /* Hide wind column if present */
  .alw-daily thead th:nth-child(4), .alw-daily tbody td:nth-child(4){ display:none; }

  /* Icon size */
  .alw-daily img.alw-icon{ width:44px; height:44px; display:block; object-fit:contain; transform:translateY(-1px); }
}


/* === Motivational toast === */
.alw-toast{ position:fixed; z-index:9999; inset:auto auto 14px 14px;
  display:none; max-width:min(92vw, 420px); padding:12px 14px 12px 12px;
  border:1.5px solid #FFA23A; background:var(--glass,#0b2a68d1);
  color:var(--fg,#fff); border-radius:14px; box-shadow:0 8px 24px rgba(0,0,0,.22);
  backdrop-filter:saturate(140%) blur(6px);
}
.alw-toast-top-left{ inset:14px auto auto 14px; }
.alw-toast-top-right{ inset:14px 14px auto auto; }
.alw-toast-bottom-right{ inset:auto 14px 14px auto; }
.alw-toast.inline{ position:static; display:block; }
.alw-toast .alw-toast-title{ font-weight:800; margin:0 26px 4px 0; }
.alw-toast .alw-toast-text{ line-height:1.35; }
.alw-toast .alw-toast-close{
  position:absolute; right:8px; top:6px; width:26px; height:26px;
  border-radius:50%; border:0; background:transparent; color:inherit;
  font-size:20px; line-height:26px; cursor:pointer;
}
@media (max-width:640px){
  .alw-toast{ max-width:92vw; }
}

/* ALW Settings styles placeholder */


/* === v2.2.53 FINAL: Mobile daily alignment using real table layout === */
@media (max-width:640px){
  .alw-widget .alw-daily{ table-layout: fixed !important; width:100% !important; border-collapse:separate !important; border-spacing:0 !important; }
  .alw-widget .alw-daily thead th:nth-child(4),
  .alw-widget .alw-daily tbody td:nth-child(4){ display:none !important; } /* hide wind */
  .alw-widget .alw-daily tbody tr{ height:auto !important; }
  .alw-widget .alw-daily tbody td{ vertical-align:middle !important; padding:8px 8px !important; line-height:1.15 !important; white-space:nowrap; }
  .alw-widget .alw-daily tbody td:first-child{ width:48% !important; white-space:normal !important; }
  .alw-widget .alw-daily tbody td:first-child .alw-dow,
  .alw-widget .alw-daily tbody td:first-child .alw-date{ display:block !important; margin:0 !important; line-height:1.05 !important; white-space:nowrap !important; }
  .alw-widget .alw-daily tbody td:nth-child(3){ width:48px !important; text-align:center !important; }
  .alw-widget .alw-daily tbody td:nth-child(5){ width:72px !important; text-align:center !important; }
  .alw-widget .alw-daily tbody td.alw-col-temp{ width:96px !important; text-align:right !important; position:relative !important; }
  .alw-widget .alw-daily tbody td.alw-col-temp::before{
    content:""; position:absolute; left:-8px; top:8px; bottom:8px; width:1px;
    background:rgba(255,255,255,.25); border-radius:1px;
  }
  .alw-widget .alw-daily img.alw-icon{ width:46px !important; height:46px !important; display:block !important; object-fit:contain !important; margin:0 auto !important; }
  /* If icon cell empty, collapse its width */
  .alw-widget .alw-daily tbody td:nth-child(3):empty{ width:0 !important; padding:0 !important; }
}

