:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary: #f59e0b;
  --secondary-dark: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --font-sans: system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --radius: 8px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}
.header-brand:hover { text-decoration: none; color: var(--secondary); }

.nav { display: flex; gap: 1rem; align-items: center; }
.nav a { color: rgba(255,255,255,0.9); font-size: 0.9rem; padding: 0.5rem 0.75rem; border-radius: var(--radius); }
.nav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; color: white; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn:hover { text-decoration: none; opacity: 0.9; transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--gray-700); }
.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-select { appearance: none; background: white; }

/* Cards */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card-header { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }

/* Grid */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--gray-100);
}
.auth-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
}
.auth-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem; }
.auth-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2rem; }

/* Event cards */
.event-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.event-card-img { width: 100%; height: 200px; object-fit: cover; }
.event-card-body { padding: 1rem; }
.event-card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.event-card-meta { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 0.5rem; }

/* Seat layout */
.seat-layout { display: flex; flex-direction: column; gap: 0.3rem; align-items: center; padding: 1rem 0; }
.seat-row { display: flex; gap: 0.3rem; align-items: center; }
.seat-row-label { width: 2rem; text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--gray-500); }
.seat {
  width: 2rem; height: 2rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: white;
}
.seat:hover { transform: scale(1.15); }
.seat.available { background: #e8f5e9; border-color: #a5d6a7; }
.seat.available:hover { background: #c8e6c9; }
.seat.selected { background: var(--primary); color: white; border-color: var(--primary); }
.seat.booked { background: var(--gray-300); color: var(--gray-500); cursor: not-allowed; border-color: var(--gray-300); }
.seat.locked { background: var(--warning); color: white; cursor: not-allowed; border-color: var(--warning); }
.seat.blocked { background: var(--danger); color: white; cursor: not-allowed; border-color: var(--danger); }

/* Screen indicator */
.screen-indicator {
  background: var(--gray-200);
  text-align: center;
  padding: 0.5rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--gray-500);
  letter-spacing: 2px;
}

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { font-weight: 600; color: var(--gray-600); background: var(--gray-50); }
tr:hover { background: var(--gray-50); }

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-title { font-size: 1.25rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray-500); }

/* Loading */
.spinner {
  width: 2rem; height: 2rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .header .container { flex-direction: column; gap: 0.5rem; }
  .nav { flex-wrap: wrap; justify-content: center; }
  .seat { width: 1.6rem; height: 1.6rem; font-size: 0.5rem; }
  .auth-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .seat { width: 1.3rem; height: 1.3rem; font-size: 0.45rem; }
  .seat-row { gap: 0.15rem; }
  .nav a { font-size: 0.8rem; padding: 0.35rem 0.5rem; }
}
