/* ========================================
   Taytr — Event Ticket Page
   Aesthetic: Cinematic / DICE-inspired
   ======================================== */

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-raised: #1a1a1a;
  --border: #252525;
  --text: #f0f0f0;
  --text-secondary: #8a8a8a;
  --text-muted: #555;
  --accent: #e8e8e8;
  --accent-hot: #ff3b30;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Hero ---- */

.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  transform: scale(1.05);
  filter: saturate(0.8);
  animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  0% { transform: scale(1.05); }
  100% { transform: scale(1.12); }
}

.hero-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(10,10,10,0.3) 0%,
      rgba(10,10,10,0.1) 30%,
      rgba(10,10,10,0.6) 60%,
      var(--bg) 100%
    );
}

/* Top bar */

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  z-index: 10;
}

.wordmark {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wordmark-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

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

.logout-form {
  display: inline;
}

.logout-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}

.logout-link:hover {
  color: var(--text);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-hot);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 100px;
  animation: livePulse 2s ease-in-out infinite;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: dotBlink 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Hero content */

.hero-content {
  position: relative;
  z-index: 5;
  padding: 0 24px 48px;
  max-width: 800px;
}

.status-tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 4px;
  margin-bottom: 16px;
}

.status-ended {
  background: var(--surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.title {
  font-family: var(--serif);
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #fff;
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}

.subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-weight: 300;
}

.subtitle em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.meta-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.meta-sep {
  color: var(--text-muted);
  font-size: 14px;
  user-select: none;
}

/* ---- Body ---- */

.body-content {
  padding: 0 24px 120px;
  max-width: 1080px;
  margin: 0 auto;
}

.body-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

/* Sections */

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-section {
  margin-bottom: 40px;
}

.about-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-weight: 300;
}

.about-text span + span {
  margin-top: 12px;
  display: block;
}

/* Creators */

.creators-section {
  margin-bottom: 40px;
}

.creators-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.creator-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
}

.creator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #333, #222);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.creator-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Details list */

.details-section {
  margin-bottom: 40px;
}

.details-list {
  display: grid;
  gap: 0;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item dt {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.detail-item dd {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

/* ---- Ticket Card (Desktop) ---- */

.ticket-card-desktop {
  display: none;
}

.ticket-card-inner {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.ticket-poster {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.ticket-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ticket-card-body {
  padding: 24px;
}

.ticket-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}

.ticket-price {
  font-family: var(--serif);
  font-size: 32px;
  color: #fff;
}

.ticket-price-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Capacity bar */

.capacity-bar-wrap {
  margin-bottom: 20px;
}

.capacity-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.capacity-fill {
  height: 100%;
  background: var(--text);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.capacity-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* Buttons */

.btn-ticket, .btn-sticky {
  display: block;
  width: 100%;
  padding: 16px 24px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.btn-buy {
  background: #fff;
  color: #000;
}

.btn-buy:hover:not(:disabled) {
  background: #e8e8e8;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255,255,255,0.1);
}

.btn-buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sold-out, .btn-ended {
  background: var(--surface-raised);
  color: var(--text-muted);
  cursor: not-allowed;
  border: 1px solid var(--border);
}

.ticket-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
}

/* Terms text */

.terms-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.terms-text a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-text a:hover {
  color: var(--text);
}

.terms-text-sticky {
  margin-top: 8px;
}

/* Purchased state */

.btn-purchased {
  background: linear-gradient(135deg, #1a3a1a, #0f2e0f);
  color: #4ade80;
  cursor: default;
  border: 1px solid #2d5a2d;
}

/* Checkout form */

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease;
}

.email-input:focus {
  border-color: var(--text-muted);
}

.email-input::placeholder {
  color: var(--text-muted);
}

.code-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 20px;
  font-weight: 600;
}

/* Flash alert */

.flash-alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  max-width: 90vw;
  text-align: center;
}

/* ---- Sticky Bottom Bar (Mobile) ---- */

.sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
}

.sticky-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.sticky-bar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sticky-price {
  font-family: var(--serif);
  font-size: 22px;
  color: #fff;
  line-height: 1;
}

.sticky-status {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-sticky {
  flex-shrink: 0;
  width: auto;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 14px;
}

.sticky-checkout-form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.sticky-email-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

.sticky-email-input:focus {
  border-color: var(--text-muted);
}

.sticky-email-input::placeholder {
  color: var(--text-muted);
}

/* ---- Footer ---- */

.page-footer {
  padding: 40px 24px 120px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-wordmark {
  font-size: 18px;
  opacity: 0.3;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.footer-links-sep {
  margin: 0 6px;
}

/* ---- Legal Pages ---- */

.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-content {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  width: 100%;
}

.legal-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.legal-content h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-content p,
.legal-content li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.legal-content ul,
.legal-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-content a:hover {
  color: #fff;
}

.legal-disclaimer {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--text-muted);
  padding: 16px 20px;
  margin-bottom: 32px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.legal-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 600;
}

/* ---- Responsive: Desktop ---- */

@media (min-width: 768px) {
  .hero {
    min-height: 75vh;
  }

  .hero-content {
    padding: 0 48px 60px;
  }

  .topbar {
    padding: 28px 48px;
  }

  .body-content {
    padding: 0 48px 80px;
  }

  .body-grid {
    grid-template-columns: 1fr 340px;
    gap: 48px;
  }

  .ticket-card-desktop {
    display: block;
  }

  .sticky-bar {
    display: none;
  }

  .page-footer {
    padding-bottom: 60px;
  }

  .footer-inner {
    padding: 0;
  }
}

@media (min-width: 1024px) {
  .body-grid {
    grid-template-columns: 1fr 380px;
    gap: 64px;
  }

  .hero-content {
    padding: 0 64px 72px;
  }

  .topbar {
    padding: 32px 64px;
  }

  .body-content {
    padding: 0 64px 80px;
  }
}

/* ---- Entrance animations ---- */

.hero-content {
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.about-section {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

.creators-section {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.details-section {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}

.ticket-card-desktop {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

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