/* ========== БАЗОВИ НАСТРОЙКИ ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at top, #e5edff 0, #f3f4f6 40%, #f3f4f6 100%);
  color: #111827;
}

/* общ контейнер за всички страници */
.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 12px;
}

/* ========== TOPBAR / HEADER ========== */

.topbar {
  background: #0b1220;
  color: #f9fafb;
    border-radius: 16px; /* заобля всички 4 ръба */
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);

  /* правим хедъра статичен (sticky) при скрол */
  position: sticky;
  top: 0;
  z-index: 100;

  /* ТОВА ПРАВИ HEADER-A BOXED */
  max-width: 1100px;      /* същата ширина като .page-shell */
  margin: 0 auto 18px;    /* центриране и лек отстъп отдолу */
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  color: #e5e7eb;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(148, 163, 184, 0.3);
}

.nav-link-active {
  background: #374151;
  color: #f9fafb;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #22c55e;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-user {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.topbar-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.xp-popover-wrap {
  position: relative;
}

.xp-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  border: 1px solid #e5e7eb;
  display: none;
  z-index: 120;
}

.xp-popover.is-open {
  display: block;
}

.xp-popover-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.xp-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  padding: 2px 0;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.logout-link:hover {
  background: #dc2626;
}

.logout-link:active {
  transform: translateY(1px);
}

/* ========== ГЛАВНИ ТИТОВЕ / КАРТИ ========== */

h1 {
  text-align: center;
  margin: 26px 0 18px;
  font-size: 2rem;
}

.card {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  margin-bottom: 18px;
}

/* ========== MOBILE (<= 600px) ========== */

@media (max-width: 600px) {
  .page-shell {
    padding: 10px 10px 28px;
  }

  .topbar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-radius: 16px; /* запазваме долното заобляне и на мобилен */
  }

  .topbar-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .topbar-title {
    font-size: 1rem;
    text-align: center;
  }

  .topbar-nav {
    display: flex;
    flex-direction: row;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 4px 10px;
  }

  .topbar-right {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .topbar-user {
    font-size: 0.8rem;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logout-link {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .xp-popover {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
  }

  h1 {
    font-size: 1.5rem;
  }

  #buttonsRow {
    flex-direction: column;
    align-items: stretch;
  }

  #nextBtn,
  #prevBtn {
    width: 100%;
  }

  /* А "Нов тест" да е бутон с нормална ширина и центриран */
  #restartBtn {
    width: auto;
    align-self: center;
  }
    
  /* Mobile оформление на "За Kontrolno.com" */
  .page-about-card {
    margin: 16px 0 32px;
    padding: 16px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
  }

}

/* ========== ГЕНЕРАЛНИ ЕЛЕМЕНТИ ========== */

label {
  display: block;
  margin-bottom: 6px;
}

select,
button,
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  font-size: 1rem;
  font-family: inherit;
}

select,
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  width: 100%;
}

button {
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.05s ease;
}

/* общ сини бутон – ползва се при нужда */
/* общ син primary бутон */
.btn-primary {
  background: #2563eb;
  color: #fff;

  padding: 8px 20px;        /* малко по-широк */
  border-radius: 9999px;    /* „pill“ форма */
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.45);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.30);
}


/* muted текст */

.muted {
  color: #6b7280;
  font-size: 0.9rem;
}

/* ==== Footer ==== */

.site-footer {
  margin-top: 40px;
  font-size: 0.9rem;
}

/* вътрешният контейнер – същата визия като header-а (topbar) */
.site-footer .page-shell {
  background: #0b1220;
  color: #f9fafb;
    border-radius: 16px; /* заоблени всички ръбове */
  padding: 16px 18px 14px;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.35); /* лека сянка „нагоре“ */
}

/* линкове във футъра */
.site-footer a {
  color: #e5e7eb;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-inner {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.footer-col {
  min-width: 160px;
}

.footer-col h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f9fafb;
}

.footer-col a {
  display: block;
  margin: 2px 0;
  font-size: 0.9rem;
}

.footer-bottom {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(55, 65, 81, 0.8);
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-col {
    width: 100%;
  }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
/* Оформление само за страницата "За нас" */
.page-about-card {
  max-width: 760px;
  margin: 32px auto 48px;
  padding: 24px 22px;        /* малко повече въздух вътре */
  line-height: 1.6;          /* по-четим текст */
  font-size: 0.98rem;
}

/* параграфите да не са залепени */
.page-about-card p {
  margin: 0 0 14px;
}

/* списъкът с булети да е ясно отделен */
.page-about-card ul {
  margin: 4px 0 18px;
  padding-left: 22px;
  list-style: disc;
}

/* заглавието над картата */
.page-about h1 {
  text-align: center; /* само центрираме, без да пипаме разстоянията */
}

/* Cookie банер */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: 520px;
  width: calc(100% - 24px);
  background: #10b981;
  color: #e5e7eb;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.55);
  font-size: 0.9rem;
  z-index: 9999;
}

.cookie-banner__text {
  margin-bottom: 8px;
  line-height: 1.4;
}

.cookie-banner__link {
  color: #93c5fd;
  text-decoration: underline;
}

.cookie-banner__buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-banner .btn-sm {
  font-size: 0.85rem;
  padding: 4px 10px;
}

.home-random-question-card h2.home-random-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.home-question-text {
  margin-bottom: 12px;
  font-weight: 600;
}

.home-question-answers {
  list-style: none;
  padding-left: 0;
  margin: 0 0 12px;
}

.home-answer-option {
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.home-answer-option label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}

.home-answer-option input {
  margin-top: 3px;
}

.home-answer-letter {
  font-weight: 700;
  min-width: 28px;
}

.home-answer-text {
  display: inline-block;
}

/* оцветяването, подобно на резултатите */
.home-answer-correct {
  background-color: #ecfdf3;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.35);
}

.home-answer-wrong {
  background-color: #fef2f2;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35);
}

.home-answer-missed {
  background-color: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.home-question-answer {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #e5e7eb;
  color: #2563eb;          /* син цвят за факта */
}


.home-answer-summary {
  margin-top: 6px;
  font-weight: 600;
}

.home-answer-summary.ok {
  color: #16a34a;
}
.dev-banner-card {
    border-left: 4px solid #facc15; /* лек жълт акцент отляво */
}

.home-answer-summary.bad {
  color: #dc2626;
}

.small-text {
  font-size: 0.85rem;
}

.dev-banner {
    background: #fef3c7;          /* светло жълто */
    color: #92400e;               /* тъмно оранжево/кафяво */
    text-align: center;
    padding: 8px 12px;
    font-size: 0.95rem;
    border-bottom: 1px solid #fed7aa;
    margin-bottom: 12px;
}

.dev-banner a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

.dev-banner a:hover {
    text-decoration: none;
}

.dev-banner-btn {
    font-size: 0.9rem;
    padding: 6px 14px;
}
