/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=DM+Mono:wght@400;500&family=Karla:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette - Light Mode */
  --forest: #24432F;
  --forest-dark: #1A3223;
  --forest-light: #2D543B;
  --flamingo: #B05F9F;
  --accent: #A24F91;
  --accent-hover: #8B3E7A;
  --link: #93437D;
  --sun: #F3EC57;
  --sun-gold: #D6CE2A;
  
  --bg: #E8E7DA;
  --surface: #F7F6EF;
  --surface-alt: #EDECE2;
  --surface-card: #FFFFFF;
  --ink: #1D2820;
  --ink-light: #3D4840;
  --muted: #5A6458;
  --muted-light: #7E897C;
  --border: rgba(29, 40, 32, 0.15);
  --border-strong: rgba(29, 40, 32, 0.3);

  /* Functional */
  --success: #2A7D45;
  --success-bg: #E8F5EC;
  --warning: #C2820A;
  --warning-bg: #FFF8E6;
  --danger: #B52A2A;
  --danger-bg: #FBEBEB;

  /* Typography */
  --font-display: 'Alfa Slab One', 'Arial Black', cursive, serif;
  --font-body: 'Karla', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Layout & Spacing */
  --header-height: 64px;
  --bottom-bar-height: 60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --forest: #3A6A4B;
    --forest-dark: #274732;
    --forest-light: #4A845F;
    --flamingo: #B05F9F;
    --accent: #CF84BD;
    --accent-hover: #DC9ACD;
    --link: #E7A6D8;
    --sun: #F3EC57;
    --sun-gold: #F7F179;

    --bg: #101612;
    --surface: #18211B;
    --surface-alt: #1F2C24;
    --surface-card: #223027;
    --ink: #E7E5D8;
    --ink-light: #C8C5B6;
    --muted: #9CA596;
    --muted-light: #767F70;
    --border: rgba(231, 229, 216, 0.15);
    --border-strong: rgba(231, 229, 216, 0.3);

    --success: #4ADE80;
    --success-bg: #132A1C;
    --warning: #FBBF24;
    --warning-bg: #2B2109;
    --danger: #F87171;
    --danger-bg: #2D1414;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
  }
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.5;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

h1.display-title, .display-font {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1rem;
}

/* Awning Motif */
.awning-stripe {
  height: 12px;
  width: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--forest) 0px,
    var(--forest) 16px,
    var(--sun) 16px,
    var(--sun) 32px
  );
  border-bottom: 2px solid rgba(0,0,0,0.15);
}

/* Header */
.app-header {
  background-color: var(--forest);
  color: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header-logo {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

/* Desktop Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.88);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  text-decoration: none;
}

.nav-link.active {
  background-color: var(--accent);
  color: #FFFFFF;
}

.nav-user-pill {
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  min-height: 44px;
  cursor: pointer;
}

.nav-user-pill:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Bottom Tab Bar (Mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  height: var(--bottom-bar-height);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 760px) {
  .header-nav {
    display: none;
  }
  .bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  body {
    padding-bottom: calc(var(--bottom-bar-height) + 12px);
  }
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  gap: 2px;
}

.bottom-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.bottom-tab.active {
  color: var(--accent);
}

/* Perforated Pitch Ticket Motif */
.pitch-ticket {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pitch-ticket:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ticket-stub {
  width: 90px;
  flex-shrink: 0;
  background-color: var(--surface-alt);
  border-right: 2px dashed var(--border-strong);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

/* Semi-circular punch-out hole on ticket perforations */
.ticket-stub::before, .ticket-stub::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background-color: var(--bg);
  border-radius: 50%;
  right: -7px;
  border: 1px solid var(--border);
}
.ticket-stub::before {
  top: -7px;
}
.ticket-stub::after {
  bottom: -7px;
}

.ticket-stub .month {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.ticket-stub .days {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--ink);
  margin: 4px 0;
}

.ticket-stub .weekdays {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.ticket-content {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Rally Book Stamp Motif */
.stamp-slot {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--border-strong);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  position: relative;
  transition: all 0.2s ease;
}

.stamp-slot.attended {
  border: 2px solid var(--forest);
  background: rgba(36, 67, 47, 0.08);
  transform: rotate(-4deg);
}

.stamp-slot.attended::after {
  content: 'ATTENDED';
  position: absolute;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--forest);
  border: 1px solid var(--forest);
  padding: 1px 3px;
  border-radius: 2px;
  bottom: 6px;
  transform: rotate(6deg);
}

.stamp-month {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stamp-venue {
  font-size: 0.65rem;
  line-height: 1.1;
  color: var(--ink);
  font-weight: 600;
  max-height: 24px;
  overflow: hidden;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  min-width: 44px;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--forest);
  color: #FFFFFF;
}
.btn-primary:hover {
  background-color: var(--forest-light);
  color: #FFFFFF;
  text-decoration: none;
}

.btn-accent {
  background-color: var(--accent);
  color: #FFFFFF;
}
.btn-accent:hover {
  background-color: var(--accent-hover);
  color: #FFFFFF;
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background-color: var(--surface);
  border-color: var(--border-strong);
  text-decoration: none;
}

.btn-sun {
  background-color: var(--sun);
  color: var(--forest-dark);
  font-weight: 700;
}
.btn-sun:hover {
  background-color: var(--sun-gold);
  text-decoration: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.badge-national,
.badge-invite {
  background-color: #FEF9C3;
  color: #713F12;
  border: 1px solid #FACC15;
}

.badge-regional {
  background-color: rgba(36, 67, 47, 0.15);
  color: var(--forest);
  border: 1px solid var(--forest);
}

.badge-paid {
  background-color: var(--success-bg);
  color: var(--success);
}

.badge-due {
  background-color: var(--warning-bg);
  color: var(--warning);
}
