/*
 * Seattle Magic Theater - Shared Styles
 * ======================================
 * This file contains all shared styles used across the site.
 * Import this in every HTML page.
 */

/* ==========================================================================
   CSS Variables (Design Tokens)
   ========================================================================== */

:root {
  /* Colors - Vibrant blue palette */
  --color-primary: #1e6fd9;          /* Lighter but vibrant blue */
  --color-primary-hover: #2e7fe9;
  --color-primary-dim: rgba(45, 125, 210, 0.15);
  --color-accent: #5a4fcf;           /* Purple accent for variety */
  --color-background: #000000;       /* Pure black like original */
  --color-surface: rgba(30, 111, 217, 0.08);
  --color-surface-hover: rgba(30, 111, 217, 0.12);
  --color-text: #f0f0f0;             /* Light text */
  --color-text-muted: #aaaaaa;       /* Muted gray */
  --color-text-faint: #777777;
  --color-border: rgba(255, 255, 255, 0.15);
  --color-border-strong: rgba(255, 255, 255, 0.3);
  --color-disabled: #555555;
  --color-white: #ffffff;
  --color-off-white: #fafafa;

  /* Typography - Modern sans pairing */
  --font-display: 'Outfit', 'Source Sans 3', sans-serif;  /* Headings - geometric, modern */
  --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;  /* Body text */
  --font-size-base: 1em;
  --font-size-sm: 0.9em;
  --font-size-lg: 1.1em;
  --font-size-xl: 1.2em;
  --font-size-2xl: 2.5em;
  --font-size-3xl: 3.2em;
  --line-height: 1.6;

  /* Spacing */
  --spacing-xs: 0.3em;
  --spacing-sm: 0.5em;
  --spacing-md: 1em;
  --spacing-lg: 2em;
  --spacing-xl: 3em;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}


/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--color-background);
  color: var(--color-text);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding: 0 8em;
  isolation: isolate;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 8em;
  right: 8em;
  bottom: 0;
  background-image: url("homepage_long.png");
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-position: center top;
  z-index: -1;
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%,
    black 3%,
    black 97%,
    transparent 100%
  );
  mask-image: linear-gradient(to right,
    transparent 0%,
    black 3%,
    black 97%,
    transparent 100%
  );
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.01em;
}

a {
  color: var(--color-text);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

/* Focus styles for keyboard accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}


/* ==========================================================================
   Layout Components
   ========================================================================== */

/* Header/Footer placeholder styling */
#site-header, #site-footer {
  background: var(--color-background);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--spacing-sm);
}


/* ==========================================================================
   Ticket Form Components
   ========================================================================== */

.ticket-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-md);
  font-size: var(--font-size-lg);
  margin-top: var(--spacing-md);
}

.ticket-column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
}

.ticket-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.ticket-row label {
  display: inline-block;
  width: 7em;
}

.ticket-price {
  font-size: var(--font-size-sm);
  opacity: 0.8;
  margin-left: var(--spacing-xs);
}

.ticket-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.ticket-controls button {
  font-size: var(--font-size-base);
  padding: 0.2em 0.6em;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.ticket-controls button:hover {
  background: var(--color-primary-hover);
}

.ticket-controls input {
  width: 2.2em;
  text-align: center;
  font-size: var(--font-size-base);
  padding: 0.1em;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-background);
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.buy-button {
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  padding: 0.7em 2em;
  cursor: pointer;
  border-radius: 999px;
  margin-top: var(--spacing-md);
  align-self: flex-start;
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 12px rgba(30, 111, 217, 0.3);
}

.buy-button:hover {
  background: var(--color-primary-hover);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 111, 217, 0.4);
}

.buy-button.soon {
  background: var(--color-disabled);
  color: var(--color-text-muted);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}


/* ==========================================================================
   Venue Logos
   ========================================================================== */

.venue-logo {
  height: 40px;
  width: auto;
  max-width: 300px;
  vertical-align: middle;
  opacity: 0.7;
}


/* ==========================================================================
   Past Events
   ========================================================================== */

.past-event-note {
  margin-top: var(--spacing-md);
  font-size: var(--font-size-lg);
  color: var(--color-text-faint);
  font-style: italic;
}

.past-events-header {
  text-align: center;
  font-size: 2.5em;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  color: var(--color-accent);
  opacity: 0.6;
}


/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }


/* ==========================================================================
   Responsive - Mobile body padding
   ========================================================================== */

@media (max-width: 800px) {
  body {
    padding-left: 2em !important;
    padding-right: 2em !important;
  }

  body::before {
    left: 2em !important;
    right: 2em !important;
  }
}

@media (max-width: 600px) {
  body {
    padding-left: 1em !important;
    padding-right: 1em !important;
  }

  body::before {
    left: 1em !important;
    right: 1em !important;
  }
}


/* ==========================================================================
   Back to Top Button
   ========================================================================== */

.back-to-top {
  position: fixed;
  bottom: 2em;
  right: 2em;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 111, 217, 0.9);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: rgba(46, 127, 233, 1);
  transform: translateY(-3px);
}


/* ==========================================================================
   Mirrored Background Sides
   ========================================================================== */

.bg-mirror {
  position: fixed;
  top: 0;
  bottom: 0;
  background-image: url("homepage_long.png");
  background-repeat: repeat-y;
  z-index: -1;
  pointer-events: none;
  background-size: var(--bg-width) auto;
}

.bg-mirror-left {
  left: 0;
  width: var(--bg-margin, 8em);
  background-position: left top;
  transform: scaleX(-1);
}

.bg-mirror-right {
  right: 0;
  width: var(--bg-margin, 8em);
  background-position: right top;
  transform: scaleX(-1);
}


/* ==========================================================================
   Slideshow Crossfade
   ========================================================================== */

.slideshow-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.slideshow-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: opacity 1s ease-in-out;
}

.slideshow-img.active {
  opacity: 1;
}

.slideshow-img.inactive {
  opacity: 0;
}


/* ==========================================================================
   Loading Skeleton
   ========================================================================== */

.skeleton-event {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5em 2.5em;
  padding: 2.5em 0;
}

.skeleton-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 2px;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  padding-top: 0.3em;
}

.skeleton-line {
  height: 1em;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 2px;
}

.skeleton-line.title { width: 60%; height: 2em; }
.skeleton-line.meta { width: 80%; }
.skeleton-line.short { width: 45%; }
.skeleton-line.long { width: 90%; }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 800px) {
  .skeleton-event {
    grid-template-columns: 1fr;
  }

  .skeleton-poster {
    max-width: 300px;
  }
}
