/* ============ NOVA — futurisztikus téma ============ */
:root {
  --bg: #070a14;
  --bg2: #0b1020;
  --glass: rgba(20, 28, 52, 0.55);
  --glass-border: rgba(94, 234, 255, 0.14);
  --cyan: #22e5ff;
  --violet: #8b5cf6;
  --pink: #f472b6;
  --text: #e8f1ff;
  --muted: #8b9bbf;
  --danger: #ff5470;
  --radius: 18px;
  --font: 'Exo 2', system-ui, sans-serif;
  --mono: 'Share Tech Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

/* háttér effektek */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 229, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 229, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 30%, transparent 80%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  width: 80vw; height: 80vw; max-width: 700px; max-height: 700px;
  top: -30vw; right: -25vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22), rgba(34, 229, 255, 0.10) 45%, transparent 70%);
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(-8vw, 10vh) scale(1.15); } }

/* ============ fejléc ============ */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(to bottom, rgba(7, 10, 20, 0.95), rgba(7, 10, 20, 0.75) 70%, transparent);
  backdrop-filter: blur(8px);
}
.brand h1 {
  font-size: 1.35rem; font-weight: 800; letter-spacing: 0.35em;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand p { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.clock { margin-left: auto; text-align: right; }
#clockTime { font-family: var(--mono); font-size: 1.5rem; color: var(--cyan); text-shadow: 0 0 18px rgba(34, 229, 255, 0.45); }
#clockDate { font-size: 0.7rem; color: var(--muted); }

/* orb */
.orb { position: relative; width: 46px; height: 46px; flex: none; cursor: pointer; }
.orb-core {
  position: absolute; inset: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--cyan) 40%, var(--violet) 90%);
  box-shadow: 0 0 22px rgba(34, 229, 255, 0.8), 0 0 50px rgba(139, 92, 246, 0.4);
  animation: pulse 3.2s ease-in-out infinite;
}
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--cyan); border-bottom-color: var(--violet);
  animation: spin 4s linear infinite;
}
.orb.speaking .orb-core { animation: pulse 0.55s ease-in-out infinite; }
.orb.listening .orb-ring { animation: spin 0.8s linear infinite; border-left-color: var(--pink); }
@keyframes pulse { 50% { transform: scale(0.86); opacity: 0.85; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ kártyák ============ */
main { padding: 6px 16px 24px; max-width: 680px; margin: 0 auto; }
.tab { display: none; animation: fadein 0.25s ease; }
.tab.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.card h2 { font-size: 0.95rem; letter-spacing: 0.06em; margin-bottom: 10px; font-weight: 700; }
.card h2 .sub { font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.hero-card { text-align: center; padding: 22px 16px; }
.greeting { font-size: 1.25rem; font-weight: 600; margin-bottom: 14px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.muted { color: var(--muted); }
.hint { font-size: 0.78rem; color: var(--muted); margin-bottom: 10px; line-height: 1.45; }

/* ============ gombok, inputok ============ */
.btn {
  font-family: var(--font); font-weight: 600; font-size: 0.9rem;
  border: 1px solid var(--glass-border); border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  padding: 10px 16px; cursor: pointer; transition: all 0.18s;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, rgba(34, 229, 255, 0.18), rgba(139, 92, 246, 0.22));
  border-color: rgba(34, 229, 255, 0.4);
  box-shadow: 0 0 16px rgba(34, 229, 255, 0.12);
}
.btn-primary:hover { box-shadow: 0 0 22px rgba(34, 229, 255, 0.3); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(255, 84, 112, 0.5); color: var(--danger); background: rgba(255, 84, 112, 0.08); }
.btn-block { width: 100%; padding: 14px; font-size: 1rem; }

input[type="text"], input[type="password"], input[type="time"], input[type="date"], select, textarea {
  font-family: var(--font); font-size: 0.95rem;
  background: rgba(7, 10, 20, 0.6); color: var(--text);
  border: 1px solid var(--glass-border); border-radius: 12px;
  padding: 10px 12px; width: 100%; outline: none;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 229, 255, 0.12); }
input[type="time"], input[type="date"] { color-scheme: dark; width: auto; }
label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
label input, label textarea { margin-top: 4px; }
select { width: auto; max-width: 55%; }
details summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
details input { margin-bottom: 8px; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0; }

/* switch */
.switch { position: relative; width: 48px; height: 26px; flex: none; margin: 0; }
.switch input { display: none; }
.switch span {
  position: absolute; inset: 0; border-radius: 20px; cursor: pointer;
  background: rgba(255, 255, 255, 0.09); border: 1px solid var(--glass-border); transition: 0.2s;
}
.switch span::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  top: 3px; left: 3px; background: var(--muted); transition: 0.2s;
}
.switch input:checked + span { background: rgba(34, 229, 255, 0.25); border-color: var(--cyan); }
.switch input:checked + span::after { left: 25px; background: var(--cyan); box-shadow: 0 0 10px rgba(34, 229, 255, 0.7); }

/* ============ időjárás ============ */
.weather-now { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.weather-temp { font-family: var(--mono); font-size: 2.6rem; color: var(--cyan); text-shadow: 0 0 24px rgba(34, 229, 255, 0.4); }
.weather-desc { line-height: 1.5; font-size: 0.9rem; }
.weather-days { display: flex; gap: 8px; }
.wday {
  flex: 1; text-align: center; padding: 10px 4px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border); font-size: 0.8rem;
}
.wday .t { font-family: var(--mono); color: var(--cyan); }

/* ============ hírek / fx / agenda ============ */
.news-item { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.news-item:last-child { border-bottom: 0; }
.news-item a { color: var(--text); text-decoration: none; font-size: 0.9rem; line-height: 1.4; }
.news-item a:hover { color: var(--cyan); }
.news-meta { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }
.news-topic { color: var(--violet); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 10px 0 2px; }

.fx-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.fx-row:last-child { border-bottom: 0; }
.fx-rate { font-family: var(--mono); color: var(--cyan); }

.agenda-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer; }
.agenda-item:last-child { border-bottom: 0; }
.agenda-time { font-family: var(--mono); color: var(--violet); flex: none; width: 5.2em; font-size: 0.9rem; }
.agenda-title { font-size: 0.92rem; }
.agenda-loc { font-size: 0.75rem; color: var(--muted); }

/* ============ naptár ============ */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-header h2 { margin: 0; text-transform: capitalize; }
.cal-source { font-size: 0.72rem; color: var(--muted); margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.68rem; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal-cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 0.85rem; cursor: pointer; border: 1px solid transparent; position: relative;
}
.cal-cell:hover { background: rgba(34, 229, 255, 0.08); }
.cal-cell.other { color: rgba(139, 155, 191, 0.4); }
.cal-cell.today { border-color: var(--cyan); color: var(--cyan); font-weight: 700; }
.cal-cell.selected { background: linear-gradient(135deg, rgba(34,229,255,0.2), rgba(139,92,246,0.25)); }
.cal-cell .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pink); position: absolute; bottom: 6px; box-shadow: 0 0 6px var(--pink); }

/* ============ chat ============ */
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 190px); }
.chat-log { flex: 1; overflow-y: auto; padding: 4px 2px; display: flex; flex-direction: column; gap: 10px; }
.msg {
  max-width: 85%; padding: 11px 14px; border-radius: 16px; font-size: 0.93rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.msg-nova {
  align-self: flex-start;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}
.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(34,229,255,0.16), rgba(139,92,246,0.22));
  border: 1px solid rgba(34,229,255,0.3);
  border-bottom-right-radius: 4px;
}
.msg-thinking { color: var(--muted); font-style: italic; }
.chat-input {
  display: flex; gap: 8px; padding: 10px 0 4px; align-items: center;
}
.chat-input input { flex: 1; }
.btn-mic {
  width: 46px; height: 46px; border-radius: 50%; flex: none; font-size: 1.1rem; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: var(--text); transition: 0.2s;
}
.btn-mic.rec {
  background: rgba(244, 114, 182, 0.25); border-color: var(--pink);
  box-shadow: 0 0 18px rgba(244, 114, 182, 0.5); animation: pulse 0.9s infinite;
}
#btnSend { border-radius: 50%; width: 46px; height: 46px; padding: 0; flex: none; }

/* ============ alsó nav ============ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(9, 12, 24, 0.88); backdrop-filter: blur(14px);
  border-top: 1px solid var(--glass-border);
}
.tabbar button {
  background: none; border: 0; color: var(--muted); font-family: var(--font);
  font-size: 0.68rem; letter-spacing: 0.04em; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 14px; border-radius: 12px;
  transition: 0.2s;
}
.tabbar button span { font-size: 1.25rem; line-height: 1; }
.tabbar button.active { color: var(--cyan); text-shadow: 0 0 12px rgba(34, 229, 255, 0.6); }

/* ============ modal ============ */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(4, 6, 12, 0.7); backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-box {
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: slideup 0.25s ease;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.modal-box h2 { margin-bottom: 14px; }
.modal-actions { margin-top: 6px; }

/* alarm / lista sorok */
.pill-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 12px;
}
.pill-row .grow { flex: 1; }
.pill-row .time { font-family: var(--mono); font-size: 1.15rem; color: var(--cyan); }
.pill-row .del { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 1.05rem; }
.alarm-days { display: flex; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.dayb {
  width: 38px; height: 32px; border-radius: 9px; border: 1px solid var(--glass-border);
  background: transparent; color: var(--muted); font-family: var(--font); font-size: 0.75rem; cursor: pointer;
}
.dayb.on { background: rgba(34,229,255,0.18); color: var(--cyan); border-color: var(--cyan); }

@media (min-width: 700px) {
  .modal { align-items: center; }
  .modal-box { border-radius: 22px; }
}

/* ============ chips (Több fül alnavigáció) ============ */
.chips { display: flex; gap: 8px; margin: 4px 0 14px; flex-wrap: wrap; }
.chip {
  font-family: var(--font); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  padding: 9px 15px; border-radius: 20px; color: var(--muted);
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); transition: 0.2s;
}
.chip.active {
  color: var(--cyan); border-color: var(--cyan);
  background: rgba(34,229,255,0.12); box-shadow: 0 0 14px rgba(34,229,255,0.18);
}
.sub { display: none; }
.sub.active { display: block; animation: fadein 0.25s ease; }

/* ============ persona választó ============ */
.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.persona-card {
  padding: 12px; border-radius: 14px; cursor: pointer; text-align: left;
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
  font-family: var(--font); color: var(--text); transition: 0.2s;
}
.persona-card:hover { border-color: rgba(34,229,255,0.4); }
.persona-card.active {
  border-color: var(--cyan);
  background: linear-gradient(135deg, rgba(34,229,255,0.14), rgba(139,92,246,0.18));
  box-shadow: 0 0 18px rgba(34,229,255,0.2);
}
.persona-card .p-emoji { font-size: 1.5rem; }
.persona-card .p-name { font-weight: 700; font-size: 0.88rem; margin: 4px 0 2px; }
.persona-card .p-desc { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }

/* ============ funkciókapcsolók ============ */
.preset-row { margin-bottom: 10px; }
.feat-off { display: none !important; }
.mini-check { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--muted); margin: 0; width: auto; }
.mini-check input { width: auto; }

/* ============ célok ============ */
.goal-card {
  padding: 13px 14px; margin-bottom: 10px; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
}
.goal-head { display: flex; align-items: center; gap: 8px; }
.goal-head .g-name { font-weight: 700; flex: 1; }
.goal-head .g-edit { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; }
.goal-stats { font-size: 0.78rem; color: var(--muted); margin: 5px 0 8px; line-height: 1.5; }
.goal-stats b { color: var(--cyan); font-family: var(--mono); font-weight: 400; }
.goal-bars { display: flex; align-items: flex-end; gap: 3px; height: 42px; margin-bottom: 8px; }
.goal-bars .bar {
  flex: 1; min-height: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(to top, var(--violet), var(--cyan));
  opacity: 0.85;
}
.goal-bars .bar.empty { background: rgba(255,255,255,0.08); }
.goal-log { display: flex; gap: 6px; }
.goal-log input { width: 7em; }
.goal-world { font-size: 0.75rem; color: var(--pink); margin-top: 6px; }
.streak { color: #ffb020; }

/* ============ napló ============ */
.diary-entry {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.diary-meta { font-size: 0.72rem; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.diary-text { font-size: 0.9rem; line-height: 1.55; white-space: pre-wrap; }
.diary-analysis {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 0.85rem; line-height: 1.5;
  background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.3); white-space: pre-wrap;
}
.diary-actions { margin-top: 8px; display: flex; gap: 8px; }
#diaryText, #notesText { margin: 10px 0; }

/* ============ teendők ============ */
.todo-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.todo-item:last-child { border-bottom: 0; }
.todo-item input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--cyan); flex: none; }
.todo-item .t-text { flex: 1; font-size: 0.9rem; }
.todo-item.done .t-text { text-decoration: line-through; color: var(--muted); }
.todo-item .del { background: none; border: 0; color: var(--danger); cursor: pointer; }

/* ============ email ============ */
.email-item {
  padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer;
}
.email-item:last-child { border-bottom: 0; }
.email-from { font-size: 0.8rem; color: var(--cyan); }
.email-subject { font-weight: 600; font-size: 0.9rem; margin: 2px 0; }
.email-snippet { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.email-body {
  margin-top: 10px; padding: 12px; border-radius: 12px; font-size: 0.85rem; line-height: 1.5;
  background: rgba(7,10,20,0.55); border: 1px solid var(--glass-border);
  white-space: pre-wrap; max-height: 300px; overflow-y: auto;
}
.email-reply textarea { margin: 8px 0; }
#emailSummaryBox .diary-analysis { margin: 10px 0; }

#notesRecStatus.rec { color: var(--pink); animation: pulse 1s infinite; }
.note-entry { font-size: 0.85rem; }
.note-summary { color: var(--cyan); }

/* ============ navigáció ============ */
.mode-btn { flex: 1; }
.mode-btn.on {
  background: linear-gradient(135deg, rgba(34,229,255,0.18), rgba(139,92,246,0.22));
  border-color: var(--cyan); color: var(--cyan);
}
.guide-panel {
  margin-top: 12px; padding: 16px; border-radius: 16px; text-align: center;
  background: rgba(7,10,20,0.6); border: 1px solid rgba(34,229,255,0.35);
  box-shadow: 0 0 24px rgba(34,229,255,0.12) inset;
}
.guide-dist {
  font-family: var(--mono); font-size: 2rem; color: var(--cyan);
  text-shadow: 0 0 18px rgba(34,229,255,0.5);
}
.guide-main { font-size: 1.15rem; font-weight: 700; margin: 8px 0; line-height: 1.4; }
.guide-next { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.btn-big { padding: 16px; font-size: 1.05rem; margin-bottom: 10px; }
#navMap {
  height: 300px; border-radius: 14px; margin-bottom: 12px; z-index: 0;
  border: 1px solid var(--glass-border); background: #0b1020;
}
#navMap .leaflet-tile { filter: brightness(0.7) contrast(1.1) saturate(0.7); } /* sötét téma a térképnek */
#btnNavFollow.on { border-color: var(--cyan); color: var(--cyan); }
.drunk-card { border-color: rgba(244, 114, 182, 0.35); }
#shareLinkBox { margin-top: 10px; }

/* ============ könyvfelolvasó ============ */
.reader-bar {
  height: 6px; border-radius: 3px; overflow: hidden;
  background: rgba(255,255,255,0.07); margin-top: 6px;
}
.reader-bar > div {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.4s;
}
.reader-current {
  padding: 14px; margin: 10px 0; border-radius: 14px;
  background: rgba(7,10,20,0.55); border: 1px solid var(--glass-border);
  font-size: 1rem; line-height: 1.65; min-height: 90px;
}
input[type="range"] { accent-color: var(--cyan); }
