/**
 * JakToMám — Layout CSS
 * Extracted from layout.php inline <style> block.
 * Nav, reset, dropdowns, mobile overlay, cookie bar, misc utilities.
 */

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-base, system-ui, sans-serif);
  background: var(--color-bg, #f4f4f4);
  color: var(--color-text, #222);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.page-astro-compare {
    background: linear-gradient(180deg, #eef2f8 0%, #e4ebf7 60%, #eef2f8 100%);

}
body.page-astro-compare::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 50, 0.03);
    pointer-events: none;
}

/* ── Nav ────────────────────────────────────────────────────────────── */
nav {
  background: var(--color-nav, #1a1a2e);
  color: #fff;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
nav a { color: #ccc; text-decoration: none; font-size: .9rem; padding: 0 .3em; }
nav a:hover { color: #fff; }
nav .brand {
  font-weight: 700; font-size: 1.1rem; color: #fff; 
  display: flex; align-items: center; gap: .45rem; text-decoration: none;
}
nav .brand svg { flex-shrink: 0; }
.nav-stats { font-size: .72rem; color: rgba(255,255,255,.32); letter-spacing: .03em; white-space: nowrap; }
.nav-stats a { color: inherit; text-decoration: none; }
.nav-stats a:hover { text-decoration: underline; }

/* ── Basic page elements ────────────────────────────────────────────── */
.container { max-width: 480px; margin: 3rem auto; padding: 0 1rem; }
.card { background: var(--color-surface, #fff); border-radius: 0; padding: 2rem; box-shadow: var(--shadow-card, 0 2px 8px rgba(0,0,0,.1)); }
h1 { font-size: 1.4rem; margin-bottom: 1.5rem; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; margin-top: 1rem; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: .55rem .75rem; border: 1px solid #ccc;
  border-radius: 0; font-size: 1rem;
}
input:focus { outline: none; border-color: var(--color-accent, #4a90d9); box-shadow: 0 0 0 2px rgba(74,144,217,.2); }
.btn {
  display: inline-block; margin-top: 1.5rem; width: 100%; padding: .65rem;
  background: var(--color-nav, #1a1a2e); color: #fff; border: none; border-radius: 0;
  font-size: 1rem; cursor: pointer;
}
.btn:hover { background: #2d2d5e; }
.error { background: var(--color-error-bg, #fde8e8); color: #b00; border-radius: 0; padding: .6rem .9rem; margin-bottom: 1rem; font-size: .9rem; }
.info { background: var(--color-info-bg, #e8f4fd); color: var(--color-info, #046); border-radius: 0; padding: .6rem .9rem; margin-bottom: 1rem; font-size: .9rem; }
.small { font-size: .85rem; margin-top: 1rem; color: #555; }
.small a { color: var(--color-accent, #4a90d9); }

/* ── Language switcher ──────────────────────────────────────────────── */
.lang-sw { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.lang-sw a {
  padding: .18rem .42rem; border-radius: 0;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  color: rgba(255,255,255,.38); text-decoration: none;
  transition: color .12s, background .12s;
}
.lang-sw a:hover { color: #fff; background: rgba(255,255,255,.12); }
.lang-sw .lang-active { color: #fff; background: rgba(255,255,255,.18); }

/* ── Shared dropdown styles ──────────────────────────────────────── */
.admin-dropdown-inner {
  background: #fff; border-radius: 0; padding: .35rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06);
}
.admin-dropdown-inner a {
  display: block; padding: .38rem .75rem; border-radius: 0;
  font-size: .83rem; color: var(--color-nav, #1a1a2e); text-decoration: none;
  white-space: nowrap; transition: background .1s, color .1s;
}
.admin-dropdown-inner a:hover { background: var(--color-surface-3, #f0f0f8); color: var(--color-nav, #1a1a2e); }
.admin-dropdown-inner hr { border: none; border-top: 1px solid #eee; margin: .3rem .4rem; }
.admin-arrow { font-size: .6rem; opacity: .55; margin-left: .2rem; vertical-align: middle; }

/* Nav submenu toggle arrow — only shown on mobile */
.nav-sub-toggle {
  display: none;
  background: none; border: none; color: rgba(255,255,255,.45);
  cursor: pointer; padding: .15rem .45rem; font-size: .6rem; line-height: 1;
  transition: color .12s; flex-shrink: 0;
}
.nav-sub-toggle:hover { color: #fff; }

/* ── Dropdown animation base ──────────────────────────────────────── */
.nav-menu-dropdown,
.nav-user-dropdown,
.admin-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s .18s;
  pointer-events: none;
}
/* Admin dropdown slides from side */
.admin-dropdown { transform: translateX(6px) translateY(0); }

/* ── Main menu dropdown (nav items with children) ─────────────────── */
.nav-menu-wrap { position: relative; display: inline-block; }
.nav-menu-wrap > a { display: block; }
.nav-menu-dropdown {
  position: absolute; top: 100%; left: 50%;
  margin-left: -90px; /* half of min-width */
  padding-top: .35rem;
  min-width: 180px; z-index: 200;
}
.nav-menu-wrap:hover > .nav-menu-dropdown,
.nav-menu-wrap:focus-within > .nav-menu-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .18s ease, transform .18s ease, visibility 0s 0s;
  pointer-events: auto;
}

/* ── User/Login dropdown ────────────────────────────────────────── */
.nav-user-wrap { position: relative; display: inline-block; margin-left: .5rem; }
.nav-user-btn {
  background: rgba(255,255,255,.12); border: none; color: #fff; cursor: pointer;
  font-size: .9rem; padding: .28rem .65rem; border-radius: 0;
  font-family: inherit; display: flex; align-items: center; gap: .3rem;
  white-space: nowrap;
}
.nav-user-btn:hover { background: rgba(255,255,255,.2); }
.nav-user-dropdown {
  position: absolute; top: 100%; right: 0;
  padding-top: .35rem; min-width: 190px; z-index: 200;
}
.nav-user-wrap:hover > .nav-user-dropdown,
.nav-user-wrap:focus-within > .nav-user-dropdown,
.nav-user-wrap.open > .nav-user-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .18s ease, transform .18s ease, visibility 0s 0s;
  pointer-events: auto;
}

/* ── Admin submenu inside user dropdown ───────────────────────────── */
.nav-admin-wrap { position: relative; display: block; }
.nav-admin-wrap > a {
  display: block; padding: .38rem .75rem; border-radius: 0;
  font-size: .83rem; color: var(--color-nav, #1a1a2e); text-decoration: none; white-space: nowrap;
}
.nav-admin-wrap > a:hover { background: var(--color-surface-3, #f0f0f8); }
.admin-dropdown {
  position: absolute; top: 0; right: 100%;
  padding-right: .35rem; min-width: 200px; z-index: 300;
}
.nav-admin-wrap:hover > .admin-dropdown,
.nav-admin-wrap:focus-within > .admin-dropdown,
.nav-admin-wrap.open > .admin-dropdown {
  opacity: 1; visibility: visible; transform: translateX(0) translateY(0);
  transition: opacity .18s ease, transform .18s ease, visibility 0s 0s;
  pointer-events: auto;
}

/* ── Overlay header & mobile-user — hidden on desktop ──────────────── */
#nav-overlay-header { display: none; }
#nav-overlay-scroll { display: contents; } /* on desktop, wrapper is transparent */
.nav-mobile-user { display: none; }
.nav-mobile-lang { display: none; }

/* ── Mobile nav ────────────────────────────────────────────────────── */
#nav-toggle {
  display: none;
  background: none; border: none; color: #fff; cursor: pointer;
  padding: .3rem .4rem; line-height: 1; flex-shrink: 0;
  font-size: 1.35rem;
}
#nav-close {
  display: none;
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 1.5rem; padding: .5rem .7rem; line-height: 1;
  min-width: 44px; min-height: 44px;
  -webkit-tap-highlight-color: rgba(255,255,255,.1);
}

/* ── Accordion (mobile submenus) — hidden on desktop ─────────────── */
.nav-accordion { display: none; }

@media (max-width: 680px) {
  nav { flex-wrap: nowrap; padding: .45rem .8rem; gap: .3rem; }
  nav .brand { margin-right: auto; font-size: 1rem; }
  /* Hide desktop-only elements on mobile */
  .lang-sw { display: none !important; }
  .nav-user-wrap { display: none !important; }
  #nav-toggle { display: block; order: 4; }

  /* ── Fullscreen overlay ─────────────────────────────────────────── */
  #nav-links {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: var(--color-nav, #1a1a2e);
    flex-direction: column;
    overflow: hidden;
  }
  #nav-links.open { display: flex; }

  #nav-overlay-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .65rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
  }
  .nav-overlay-brand {
    font-weight: 700; font-size: 1.1rem; color: #fff;
  }
  #nav-close { display: block; }

  #nav-overlay-scroll {
    display: block; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: .5rem 0;
  }

  /* Links inside overlay */
  #nav-overlay-scroll > a,
  #nav-overlay-scroll > span,
  #nav-overlay-scroll > .nav-menu-wrap {
    display: block;
    padding: .75rem 1.2rem;
    font-size: 1rem;
    color: #ccc;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  #nav-overlay-scroll > a:hover { color: #fff; background: rgba(255,255,255,.05); }
  #nav-overlay-scroll > span.nav-stats { white-space: normal; font-size: .78rem; }

  /* ── Nav-menu-wrap accordion (items with children) ──────────────── */
  .nav-menu-wrap {
    display: flex !important; flex-wrap: wrap; align-items: center;
  }
  .nav-menu-wrap > a {
    flex: 1; padding: 0 !important; border: none !important;
    font-size: 1rem; color: #ccc;
  }
  .nav-sub-toggle {
    display: inline-block;
    padding: .4rem .6rem; font-size: .7rem;
    transition: transform .2s;
  }
  .nav-menu-wrap.open > .nav-sub-toggle { transform: rotate(90deg); }
  /* Reset desktop dropdown — hidden by default, only .open shows it */
  .nav-menu-dropdown {
    display: none !important;
    position: static !important; width: 100%; margin-left: 0 !important;
    padding: 0 !important; min-width: 0 !important;
    opacity: 1 !important; visibility: visible !important;
    transform: none !important; pointer-events: auto !important;
  }
  .nav-menu-wrap.open > .nav-menu-dropdown {
    display: block !important;
  }
  .nav-menu-dropdown .admin-dropdown-inner {
    background: transparent !important; border-radius: 0 !important;
    box-shadow: none !important; margin: 0; padding: .2rem 0;
  }
  .nav-menu-dropdown .admin-dropdown-inner a {
    color: rgba(255,255,255,.75) !important; padding: .55rem 1.2rem .55rem 2rem; font-size: .92rem;
  }
  .nav-menu-dropdown .admin-dropdown-inner a:hover { color: #fff !important; background: rgba(255,255,255,.08); }

  /* ── Mobile user section ────────────────────────────────────────── */
  .nav-mobile-user {
    display: block; padding: 0 1.2rem .5rem;
  }
  .nav-mobile-user hr {
    border: none; border-top: 1px solid rgba(255,255,255,.1); margin: .5rem 0;
  }
  .nav-mobile-user a {
    display: block; padding: .6rem 0; color: #ccc; text-decoration: none;
    font-size: .95rem;
  }
  .nav-mobile-user a:hover { color: #fff; }
  .nav-mobile-cta {
    color: #fff !important; font-weight: 600; font-size: 1rem !important;
  }

  /* ── Accordion for admin ────────────────────────────────────────── */
  .nav-accordion { display: block; }
  .nav-accordion-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; background: none; border: none; color: #ccc;
    font-size: .95rem; font-family: inherit; padding: .6rem 0;
    cursor: pointer; text-align: left;
  }
  .nav-accordion-toggle:hover { color: #fff; }
  .nav-accordion-arrow {
    font-size: .6rem; transition: transform .2s; opacity: .55;
  }
  .nav-accordion.open .nav-accordion-arrow { transform: rotate(90deg); }
  .nav-accordion-body {
    display: none; padding-left: 1rem;
  }
  .nav-accordion.open .nav-accordion-body { display: block; }
  .nav-accordion-body a {
    padding: .45rem 0 !important; font-size: .88rem !important; color: #aaa !important;
  }
  .nav-accordion-body a:hover { color: #fff !important; }

  /* ── Language in overlay ─────────────────────────────────────────── */
  .nav-mobile-lang {
    display: flex; gap: .5rem; padding: .6rem 0; margin-top: .3rem;
  }
  .nav-mobile-lang a {
    display: inline-block !important; padding: .25rem .6rem !important;
    border-radius: 0; font-size: .78rem !important; font-weight: 700;
    letter-spacing: .04em; color: rgba(255,255,255,.4) !important;
  }
  .nav-mobile-lang a:hover { color: #fff !important; background: rgba(255,255,255,.1); }
  .nav-mobile-lang .lang-active { color: #fff !important; background: rgba(255,255,255,.18); }

  /* ── Body scroll lock ───────────────────────────────────────────── */
  body.nav-open { overflow: hidden; }

  /* Reset desktop dropdown animations on mobile */
  .nav-user-dropdown, .admin-dropdown {
    position: static; padding: 0;
    display: none; opacity: 1; visibility: visible; transform: none;
    transition: none; pointer-events: auto;
  }
}

/* ── Guest tab ──────────────────────────────────────────────────────── */
#guest-tab {
  position: fixed; top: 72px; right: 0; z-index: 900;
  display: flex; align-items: flex-start;
  transition: transform .3s ease;
  transform: translateX(calc(100% - 44px));
}
#guest-tab.open { transform: translateX(0); }
#guest-tab.dismissed { display: none; }
#guest-tab-handle {
  writing-mode: vertical-lr; text-orientation: mixed;
  background: var(--color-accent, #4a90d9); color: #fff;
  padding: .7rem .45rem; border-radius: 0;
  cursor: pointer; font-size: .82rem; font-weight: 600;
  display: flex; align-items: center; gap: .4rem;
  box-shadow: -2px 2px 8px rgba(0,0,0,.15);
  animation: guest-pulse 3s ease-in-out infinite;
  user-select: none;
}
#guest-tab.open #guest-tab-handle { animation: none; }
.guest-tab-icon { font-size: 1rem; }
@keyframes guest-pulse {
  0%, 100% { box-shadow: -2px 2px 8px rgba(0,0,0,.15); }
  50% { box-shadow: -2px 2px 16px rgba(74,144,217,.5); }
}
#guest-tab-panel {
  background: var(--color-surface, #fff); border: 1px solid #e5e7eb;
  border-radius: 0; padding: 1.1rem 1rem; width: 280px;
  box-shadow: -2px 4px 16px rgba(0,0,0,.12); position: relative;
}
#guest-tab-close {
  position: absolute; top: .3rem; right: .5rem;
  background: none; border: none; font-size: 1.2rem; color: #999;
  cursor: pointer; line-height: 1;
}
#guest-tab-close:hover { color: #333; }
.guest-tab-msg {
  font-size: .88rem; color: var(--color-text-2, #374151);
  margin: 0 0 .7rem; line-height: 1.45; font-weight: 600;
}
#guest-tab-email {
  width: 100%; padding: .5rem .65rem; border: 1px solid #d1d5db;
  border-radius: 0; font-size: .9rem; font-family: inherit;
  background: #f9fafb;
}
#guest-tab-email:focus { outline: none; border-color: var(--color-accent, #4a90d9); box-shadow: 0 0 0 2px rgba(74,144,217,.15); }
#guest-tab-submit {
  display: block; width: 100%; margin-top: .5rem; padding: .5rem;
  background: var(--color-accent, #4a90d9); color: #fff; border: none;
  border-radius: 0; font-size: .88rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
#guest-tab-submit:hover { background: var(--color-accent-hover, #3578c0); }
#guest-tab-submit:disabled { opacity: .6; cursor: wait; }
#guest-tab-error { color: #dc2626; font-size: .8rem; margin: .4rem 0 0; }
#guest-tab-ok p { font-size: .88rem; color: #065f46; font-weight: 600; margin: 0 0 .5rem; line-height: 1.45; }
.guest-tab-link { font-size: .82rem; color: var(--color-accent, #4a90d9); }
.guest-tab-google {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: .45rem .6rem; margin-bottom: .1rem;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 3px;
  font-size: .85rem; font-weight: 500; text-decoration: none;
  transition: background .15s, box-shadow .15s;
}
.guest-tab-google:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

@media (max-width: 600px) {
  #guest-tab {
    top: auto; bottom: 0; right: 0; left: 0;
    transform: translateY(calc(100% - 38px));
    flex-direction: column-reverse; align-items: stretch;
  }
  #guest-tab.open { transform: translateY(0); }
  #guest-tab-handle {
    writing-mode: horizontal-tb; text-orientation: initial;
    border-radius: 0; padding: .5rem .8rem;
    justify-content: center;
  }
  #guest-tab-panel { width: auto; border-radius: 0; }
}

/* ── Set-password tab (legacy users via magic link) ─────────────────── */
#set-pw-tab {
  position: fixed; top: 72px; right: 0; z-index: 900;
  display: flex; align-items: flex-start;
  transition: transform .3s ease;
  transform: translateX(calc(100% - 44px));
}
#set-pw-tab.open { transform: translateX(0); }
#set-pw-tab-handle {
  writing-mode: vertical-lr; text-orientation: mixed;
  background: #4f46e5; color: #fff;
  padding: .7rem .45rem;
  cursor: pointer; font-size: .82rem; font-weight: 600;
  display: flex; align-items: center; gap: .4rem;
  box-shadow: -2px 2px 8px rgba(0,0,0,.15);
  animation: set-pw-pulse 3s ease-in-out infinite;
  user-select: none;
}
#set-pw-tab.open #set-pw-tab-handle { animation: none; }
@keyframes set-pw-pulse {
  0%, 100% { box-shadow: -2px 2px 8px rgba(0,0,0,.15); }
  50% { box-shadow: -2px 2px 16px rgba(79,70,229,.5); }
}
#set-pw-tab-panel {
  background: var(--color-surface, #fff); border: 1px solid #e5e7eb;
  padding: 1.1rem 1rem; width: 280px;
  box-shadow: -2px 4px 16px rgba(0,0,0,.12); position: relative;
}
#set-pw-tab-close {
  position: absolute; top: .3rem; right: .5rem;
  background: none; border: none; font-size: 1.2rem; color: #999;
  cursor: pointer; line-height: 1;
}
#set-pw-tab-close:hover { color: #333; }
#set-pw-input, #set-pw-confirm {
  display: block; width: 100%; padding: .5rem .65rem; border: 1px solid #d1d5db;
  font-size: .9rem; font-family: inherit; background: #f9fafb; box-sizing: border-box;
}
#set-pw-input:focus, #set-pw-confirm:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 2px rgba(79,70,229,.15); }
#set-pw-submit {
  display: block; width: 100%; margin-top: .5rem; padding: .5rem;
  background: #4f46e5; color: #fff; border: none;
  font-size: .88rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
#set-pw-submit:hover { background: #4338ca; }
#set-pw-submit:disabled { opacity: .6; cursor: wait; }
#set-pw-error { color: #dc2626; font-size: .8rem; margin: .4rem 0 0; }
#set-pw-ok p { font-size: .88rem; color: #065f46; font-weight: 600; margin: 0; line-height: 1.45; }
@media (max-width: 600px) {
  #set-pw-tab {
    top: auto; bottom: 0; right: 0; left: 0;
    transform: translateY(calc(100% - 38px));
    flex-direction: column-reverse; align-items: stretch;
  }
  #set-pw-tab.open { transform: translateY(0); }
  #set-pw-tab-handle { writing-mode: horizontal-tb; text-orientation: initial; padding: .5rem .8rem; justify-content: center; }
  #set-pw-tab-panel { width: auto; }
}

/* ── Cookie bar ─────────────────────────────────────────────────────── */
#cookie-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #f0ece6; border-top: 1px solid #ddd8d0;
  padding: .65rem 1.5rem; gap: 1rem; align-items: center; flex-wrap: wrap;
  font-size: .82rem; color: #555; z-index: 999;
}
#cookie-bar a { color: var(--color-accent, #4a90d9); }
#cookie-bar button {
  padding: .3rem .85rem; background: var(--color-nav, #1a1a2e); color: #fff;
  border: none; border-radius: 0; font-size: .82rem; cursor: pointer;
}
#cookie-bar button:hover { background: #2d2d5e; }

/* ── Demo loading spinner ───────────────────────────────────────────── */
.demo-loading { pointer-events: none; opacity: .7; position: relative; }
.demo-loading::after {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-left: .4rem;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: demo-spin .6s linear infinite; vertical-align: middle;
}
@keyframes demo-spin { to { transform: rotate(360deg); }  }

