/* =========================
   Holnap/Órás oldal – EGYSÉGES topbar + mobil
========================= */

:root{
  --card: rgba(245,248,252,0.75);

  --topbar-fg: #fff;
  --topbar-accent: #3b82f6;
  --topbar-muted: #cbd5e1;

  --text: #111827;
  --muted: #3f4c5f;
  --sep: rgba(15,23,42,0.18);
}

/* =========================
   Alap
========================= */

*{ box-sizing: border-box; }

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body{
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  background-color: #9bd3fb;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  padding-top: 72px; /* hely a fixed topbar számára (desktop) */
}

button{
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
}

/* =========================
   Topbar (egységes)
========================= */

.topbar{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  background: transparent;
  box-shadow: none;
}

.topbar-inner{
  height: 52px;
  max-width: 940px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.brand{
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--topbar-fg);
  margin-right: 6px;
}

.main-nav{
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--topbar-accent);
  padding: 6px 54px;
  margin: 0 12px;
  border-radius: 8px;
}

.nav-link{
  position: relative;
  padding: 6px 2px;
  text-decoration: none;
  color: var(--topbar-fg);
  font-weight: 600;
  letter-spacing: .3px;
  font-size: 20px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.35);
}
.nav-link:hover{ color: #dbeafe; }

.nav-link.active{ color: #fff; }
.nav-link.active::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* Dropdown */
.nav-dropdown{
  position: relative;
  display: flex;
  align-items: center;
}
.nav-link-has-menu{
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-caret{
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(255,255,255,0.9);
  transition: transform 0.16s ease, border-top-color 0.16s ease;
}

.nav-dropdown-menu{
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  display: flex;
  flex-direction: column;
  min-width: 140px;
  padding: 10px;
  background: #f8fbff;
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.24);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 7500;
}

/* Desktopon hover/focus működjön */
.nav-dropdown.open .nav-dropdown-menu{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 4px);
}
.nav-dropdown.open .nav-caret{
  transform: translateY(1px) rotate(180deg);
  border-top-color: #dbeafe;
}

/* Mobil / JS toggle: .open class-szal nyitjuk */
.nav-dropdown.open .nav-dropdown-menu{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.nav-dropdown.open .nav-caret{
  transform: translateY(1px) rotate(180deg);
  border-top-color: #dbeafe;
}

.dropdown-link{
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: .2px;
}
.dropdown-link:hover{
  background: rgba(59, 130, 246, 0.12);
  color: var(--topbar-accent);
}
.dropdown-link.active{
  background: rgba(59, 130, 246, 0.18);
  color: var(--topbar-accent);
}

/* Kereső ikon gomb */
.icon-btn{
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, #2f8bff, #1d73eb);
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 10px 20px rgba(18, 89, 180, 0.32),
    0 2px 6px rgba(18, 89, 180, 0.28);
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.icon-btn:hover{
  background: linear-gradient(135deg, #3494ff, #2680f0);
  transform: translateY(-1px);
  box-shadow:
    0 12px 24px rgba(18, 89, 180, 0.36),
    0 3px 8px rgba(18, 89, 180, 0.32);
}
.icon-btn svg{ display:block; }

/* Topbar kereső */
.top-search{
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-search input{
  width: 200px;
  height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(15,23,42,0.16);
  border-radius: 10px;
  background: rgba(248,251,255,0.95);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(15,23,42,0.12);
}
.top-search input::placeholder{ color: #8fa0b5; }

/* =========================
   Tartalom wrap + órás slotok
========================= */

.wrap{
  width: min(900px, 92vw);
  background: var(--card);
  border: 1px solid var(--sep);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  overflow: hidden;
}

.header{
  padding: 18px 22px;
  border-bottom: 1px solid var(--sep);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.header h1{
  font-size: 18px;
  margin: 0;
  letter-spacing: .3px;
}
.header .sub{
  color: var(--muted);
  font-size: 14px;
}

/* Egy “kisebb rész” (időjárás slot) */
.slot{
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #d1d5db;
}
.slot:last-child{ border-bottom: none; }

/* Bal oldal */
.slot-left{
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
}
.time{
  align-self: start;
  font-weight: 700;
  font-size: 20px;
}
.bottom-left{
  align-self: end;
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.temp{
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .5px;
}
.emoji{
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}
.desc{
  margin-left: 6px;
  color: var(--muted);
  font-size: 14px;
}

/* Jobb oldal */
.slot-right{
  display: grid;
  align-content: start;
  row-gap: 12px;
  border-left: 1px dashed var(--sep);
  padding-left: 18px;
}

.metric{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 6px 0;
}
.metric .label{ color: var(--muted); font-size: 14px; }
.metric .value{ font-weight: 700; }

.badge{
  display:inline-block;
  padding: 2px 8px;
  border: 1px solid var(--sep);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

/* Summary táblázat (ha használod) */
.summary-table{
  width: 100%;
  max-width: 520px;
  background: #f4f6f8;
  border: 1px solid #d6d9de;
  border-radius: 10px;
  overflow: hidden;
  font-size: 14px;
  margin-top: 6px;
}
.summary-head, .summary-row{
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  align-items: center;
}
.summary-head{
  background: #e5e9ef;
  font-weight: 700;
}
.summary-row:nth-child(odd){ background: #f9fafb; }
.summary-row:nth-child(even){ background: #f1f5f9; }
.summary-row div:first-child{ font-weight: 600; }

/* Archivum grafikonok */
.archive-charts{
  display: grid;
  gap: 12px;
}
.archive-chart{
  width: 100%;
  max-width: 100%;
  height: 160px !important;
  display: block;
}

/* =========================
   Reszponzív
========================= */

/* 640 alatt: slot 1 oszlop, jobb oldal 2 oszlopos metrikákkal */
@media (max-width: 640px){
  .slot{
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .slot-right{
    border-left: none;
    border-top: 1px dashed var(--sep);
    padding-left: 0;
    padding-top: 12px;
    grid-template-columns: 1fr 1fr;
    row-gap: 10px;
    column-gap: 12px;
  }
  .metric{ padding: 0; }
}

/* =========================
   Mobil topbar (EGYSÉGES a fő style.css-sel)
========================= */
@media (max-width: 768px){

  /* mobilon NE center-grid legyen */
  body{
    display: block;
    place-items: initial;
    padding-top: 120px;
    padding-left: 12px;
    padding-right: 12px;
    overflow-x: hidden;
  }

  .topbar{
    background: rgba(53,120,229,0.92);
    backdrop-filter: blur(6px);
  }

  .topbar-inner{
    height: auto;
    max-width: 100%;
    padding: 10px 12px;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand{
    order: 1;
    margin-right: 0;
    font-size: 16px;
  }

  .top-search{
    order: 2;
    flex: 1 1 180px;
    min-width: 160px;
  }
  .top-search input{
    width: 100%;
    height: 36px;
    padding: 8px 10px;
    border-radius: 12px;
  }

  .icon-btn{
    order: 3;
    width: 40px;
    height: 40px;
    display: none; /* ha kell, vedd ki */
  }

  .main-nav{
    order: 4;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    gap: 12px;

    overflow-x: auto;
    overflow-y: visible; /* ne vágja le a dropdown-t */
    white-space: nowrap;
    max-width: 100%;

    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .main-nav::-webkit-scrollbar{ display:none; height:0; }

  .nav-link{ font-size: 15px; }

  /* dropdown mobilon jobbra nyíljon */
  .nav-dropdown-menu{
    left: auto;
    right: 0;
    transform: translate(0, 8px);
    min-width: 170px;
  }

  /* wrap legyen full width */
  .wrap{ width: 100%; }
}

/* nagyon kicsi mobil */
@media (max-width: 520px){
  .nav-link{ font-size: 14px; }
  .top-search input{ height: 34px; }
  .temp{ font-size: 34px; }
  .emoji{ font-size: 30px; }
}
