/* ============================================================
   Beer-Mate: Styles — Taphouse-inspireret design
   ============================================================ */

/* ----- Reset & Custom Properties ----- */

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

:root {
  --primary: #B31919;
  --primary-dark: #8B0000;
  --primary-light: #F2E7E7;
  --accent: #C4953A;
  --bg: #FCF3F3;
  --card-bg: #FCF3F3;
  --text: #400202;
  --text-light: #501010;
  --border: #E8E3DE;
  --radius: 3px;
  --max-width: 480px;
}

/* ----- Base ----- */

body {
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ----- Header & Navigation ----- */

header {
  background: var(--primary);
  color: #fff;
  padding: 1.2rem 1rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  height: 28px;
  display: block;
}

/* Burger button */

.burger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  position: absolute;
  right: 0;
  -webkit-tap-highlight-color: transparent;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
}

.burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay */

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 90;
}

.nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Slide-in drawer */

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: var(--primary);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding-top: 5rem;
}

.nav-drawer.open {
  transform: translateX(0);
}

.nav-link {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s, color 0.2s;
}

.nav-desc {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.55;
  margin-top: 3px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-link.active {
  color: #fff;
  border-left: 3px solid var(--accent);
  padding-left: calc(1.5rem - 3px);
}

/* ----- Main Container ----- */

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  width: 100%;
}

/* ----- Landing Page CTAs ----- */

.landing {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.cta-card {
  display: block;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  position: relative;
  transition: box-shadow 0.2s, transform 0.15s;
}

.cta-card:active {
  transform: scale(0.98);
}

.cta-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--text);
}

.cta-card p {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.75rem 0;
  color: var(--primary);
}

.cta-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
}

.cta-arrow {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 300;
}

/* ----- Screen Switching ----- */

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- Intro Screen ----- */

#intro {
  text-align: center;
  padding-top: 4rem;
}

#intro h1 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.intro-text {
  color: var(--text-light);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- Buttons ----- */

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.85rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
  margin-top: 2.5rem;
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

/* ----- Progress Bar ----- */

.progress {
  margin-bottom: 2rem;
}

.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0;
}

.progress-text {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.4rem;
}

/* ----- Quiz ----- */

#quiz h2 {
  font-size: 1.35rem;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.answers.fade-in {
  animation: fadeIn 0.3s ease;
}

.answer-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.answer-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.answer-card:active {
  transform: scale(0.98);
}

.answer-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ----- Loading ----- */

#loading {
  text-align: center;
  padding-top: 5rem;
}

#loading p {
  color: var(--text-light);
  font-size: 1.05rem;
}

.loader {
  width: 44px;
  height: 44px;
  border: 3.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----- Results ----- */

#results h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

#results h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light);
  margin: 2.25rem 0 0.75rem;
}

.taste-desc {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
}

/* Category cards */

.categories {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.category-card {
  background: var(--card-bg);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.1rem;
}

.cat-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.cat-desc {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

/* Beer cards — Taphouse design */

.beer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.beer-card {
  background: var(--card-bg);
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.25);
  border-radius: var(--radius);
  height: 105px;
  position: relative;
  overflow: hidden;
}

.beer-card.open {
  height: auto;
  padding: 0 0 37px 0;
}

.beer-card.happy-hour {
  background-color: var(--primary-light);
  border: 2px solid var(--primary);
  box-sizing: border-box;
  overflow: visible;
}

.beer-card.happy-hour::after {
  content: "%";
  color: #fff;
  font-size: 10px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  position: absolute;
  top: calc(50% - 9px);
  left: -9px;
  width: 18px;
  height: 18px;
  aspect-ratio: 1;
  clip-path: polygon(100% 50%,87.59% 63.68%,88.3% 82.14%,70% 84.64%,58.68% 99.24%,43.05% 89.39%,25% 93.3%,19.36% 75.71%,3.02% 67.1%,10% 50%,3.02% 32.9%,19.36% 24.29%,25% 6.7%,43.05% 10.61%,58.68% 0.76%,70% 15.36%,88.3% 17.86%,87.59% 36.32%);
}

.happy-hour .beer-percent {
  top: 24px;
}

.happy-hour .beer-meta p {
  top: 0;
}

.beer-card .right_part {
  float: right;
  white-space: nowrap;
  padding: 5px 5px 0 0;
  margin-left: 15px;
}

.beer-card .left_part {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Beer name */

.beer-title p {
  color: var(--primary);
  font-size: 20px;
  font-weight: 500;
  text-transform: uppercase;
  padding: 10px 0 0 12px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.beer-title p.open {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.beer-title span {
  padding: 0 0 0 12px;
  font-size: 12px;
  color: var(--text-light);
}

/* Untappd link circle */

.beer-link {
  width: 18px;
  height: 18px;
  background-color: var(--primary);
  color: #fff;
  display: inline-block;
  border-radius: 18px;
  font-weight: 600;
  font-size: 12px;
  line-height: 19px;
  text-align: center;
  cursor: pointer;
}

/* Category type badge */

.beer-type {
  color: #fff;
  padding: 3px 6px;
  font-size: 9px;
  text-transform: uppercase;
  border-radius: 2px;
  font-weight: 500;
  position: relative;
  top: -1px;
}

.beer-type.cat-ipa         { background-color: #069a03; }
.beer-type.cat-pale-ale    { background-color: #e6c900; color: #501010; }
.beer-type.cat-dark-ale    { background-color: #79472f; }
.beer-type.cat-wheat       { background-color: #ffffff; color: #501010; border: 1px solid #ccc; }
.beer-type.cat-sour        { background-color: #910094; }
.beer-type.cat-smoked      { background-color: #666666; }
.beer-type.cat-lager       { background-color: #f9f99b; color: #501010; }
.beer-type.cat-dark-lager  { background-color: #501010; }
.beer-type.cat-stout       { background-color: #000000; }
.beer-type.cat-belgian     { background-color: #e26e0d; }
.beer-type.cat-cider       { background-color: #126aa0; }
.beer-type.cat-other       { background-color: #bbbbbb; }

/* Prices (bottom-right, floated) */

.beer-prices {
  font-size: 12px;
  color: var(--text-light);
  position: relative;
  top: 22px;
}

.beer-prices span {
  display: inline-block;
  margin-left: 8px;
}

/* ABV (bottom-left) */

.beer-percent {
  padding: 0 0 0 12px;
  font-size: 12px;
  color: var(--text);
  position: relative;
  top: 26px;
  font-weight: 400;
}

/* Rating (inline after ABV) */

.beer-rating {
  color: var(--text-light);
  font-weight: 500;
  margin-left: 6px;
}

.rating-source {
  font-weight: 300;
  font-size: 9px;
  text-transform: uppercase;
  opacity: 0.6;
}


/* ----- Page Title (subpages) ----- */

.page-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ----- Filter Bar ----- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.filter-chip {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text-light);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ----- Beer Count ----- */

.beer-count {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

