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

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

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

:root {
  --primary: #7B1F2E;
  --primary-dark: #5C1722;
  --primary-light: rgba(123, 31, 46, 0.08);
  --accent: #C4953A;
  --bg: #FAF9F7;
  --card-bg: #FFFFFF;
  --text: #2D2D2D;
  --text-light: #7A7570;
  --border: #E8E3DE;
  --radius: 12px;
  --max-width: 480px;
}

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

body {
  font-family: "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 ----- */

header {
  background: var(--primary);
  color: #fff;
  padding: 0.9rem 1rem;
  text-align: center;
}

.logo {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

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

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

/* ----- 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 */

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

.beer-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.beer-info {
  min-width: 0;
}

.beer-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.beer-style {
  color: var(--text-light);
  font-size: 0.8rem;
  margin-top: 0.1rem;
}

.beer-abv {
  color: var(--text-light);
  font-size: 0.75rem;
}

.beer-match {
  background: var(--primary);
  color: #fff;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}
