/* ============================================================
   QR Ticket System - Global Styles
   Aesthetic: Luxury Event / Dark Elegance with Gold Accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --bg-primary: #0A0A0F;
  --bg-secondary: #12121A;
  --bg-card: #1A1A25;
  --bg-elevated: #22223A;
  --border: rgba(255,255,255,0.08);
  --border-accent: rgba(201,169,100,0.3);

  --text-primary: #F0EDE8;
  --text-secondary: #9A948A;
  --text-muted: #5A5550;

  --gold: #C9A964;
  --gold-light: #E8C97A;
  --gold-dark: #A08040;
  --platinum: #B8C4CC;
  --silver-color: #8A9BA8;

  --success: #4CAF82;
  --error: #E05555;
  --warning: #E09A45;
  --info: #5588E0;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 24px rgba(201,169,100,0.15);

  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --nav-height: 70px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% -10%, rgba(201,169,100,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 600px 400px at 80% 110%, rgba(90,60,200,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

main { position: relative; z-index: 1; }

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

img { max-width: 100%; display: block; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p { color: var(--text-secondary); }

.gold-text { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

/* ── Navigation ─────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 clamp(1rem, 4vw, 3rem);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  gap: 2rem;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  list-style: none;
}

.navbar-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: all var(--transition);
  text-decoration: none;
}

.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: 2px solid var(--border-accent);
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  color: #1A1205;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card);
  border-color: var(--border-accent);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
}
.btn-outline:hover:not(:disabled) {
  background: rgba(201,169,100,0.1);
}

.btn-danger {
  background: rgba(224,85,85,0.15);
  color: var(--error);
  border: 1px solid rgba(224,85,85,0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(224,85,85,0.25);
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; border-radius: 14px; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.5rem; border-radius: 8px; width: 36px; height: 36px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover { border-color: var(--border-accent); box-shadow: var(--shadow); }

.card-body { padding: 1.5rem; }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(201,169,100,0.12);
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A948A' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-error { color: var(--error); font-size: 0.82rem; }
.form-hint { color: var(--text-muted); font-size: 0.82rem; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-platinum { background: rgba(184,196,204,0.15); color: var(--platinum); border: 1px solid rgba(184,196,204,0.3); }
.badge-gold { background: rgba(201,169,100,0.15); color: var(--gold); border: 1px solid rgba(201,169,100,0.3); }
.badge-silver { background: rgba(138,155,168,0.15); color: var(--silver-color); border: 1px solid rgba(138,155,168,0.3); }
.badge-success { background: rgba(76,175,130,0.15); color: var(--success); border: 1px solid rgba(76,175,130,0.3); }
.badge-error { background: rgba(224,85,85,0.15); color: var(--error); border: 1px solid rgba(224,85,85,0.3); }
.badge-warning { background: rgba(224,154,69,0.15); color: var(--warning); border: 1px solid rgba(224,154,69,0.3); }
.badge-info { background: rgba(85,136,224,0.15); color: var(--info); border: 1px solid rgba(85,136,224,0.3); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
}
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Stats Grid ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(201,169,100,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none; /* YE LINE ADD KARNI HAI */
  transition: opacity var(--transition);
}

.modal-overlay.show { 
  opacity: 1; 
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.show .modal { transform: translateY(0); }

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; justify-content: flex-end; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-elevated); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 1rem);
  right: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 360px;
  pointer-events: auto;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.toast.show { transform: translateX(0); }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { background: rgba(76,175,130,0.2); color: var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-error .toast-icon { background: rgba(224,85,85,0.2); color: var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .toast-icon { background: rgba(224,154,69,0.2); color: var(--warning); }
.toast-info { border-left: 3px solid var(--info); }
.toast-info .toast-icon { background: rgba(85,136,224,0.2); color: var(--info); }

/* ── Global Loader ───────────────────────────────────────────── */
#global-loader {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-text { color: var(--text-secondary); font-size: 0.9rem; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page layouts ────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.page-header { padding: 3rem 0 2rem; }
.page-title { margin-bottom: 0.5rem; }
.page-subtitle { color: var(--text-secondary); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .navbar-nav { display: none; }
  .navbar-nav.open { display: flex; flex-direction: column; position: fixed; inset: var(--nav-height) 0 0; background: var(--bg-secondary); padding: 1rem; z-index: 999; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.fade-in { animation: fadeInUp 0.4s ease both; }
.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* ── Skeleton Loading ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 0.5rem; }

/* ── Ticket Visual ───────────────────────────────────────────── */
.ticket-card {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.ticket-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: var(--ticket-gradient, linear-gradient(135deg, #C0A882, #E8D5B0, #A08060));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.ticket-platinum { --ticket-gradient: linear-gradient(135deg, #C0A882, #F0E8D0, #A08060, #D4C0A0); }
.ticket-gold { --ticket-gradient: linear-gradient(135deg, #FFD700, #FFF0A0, #B8860B, #FFD700); }
.ticket-silver { --ticket-gradient: linear-gradient(135deg, #C0C0C0, #E8E8F0, #808090, #C0C0C0); }

.ticket-header {
  padding: 1.25rem 1.5rem;
  background: var(--ticket-header-bg, rgba(201,169,100,0.08));
  border-bottom: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ticket-body { padding: 1.25rem 1.5rem; }
.ticket-footer {
  padding: 1rem 1.5rem;
  background: rgba(0,0,0,0.2);
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Perforated ticket effect ────────────────────────────────── */
.ticket-tear {
  position: relative;
  display: flex;
  align-items: center;
  gap: -8px;
}
.ticket-tear::before, .ticket-tear::after {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--bg-primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Seat Number Display ─────────────────────────────────────── */
.seat-display {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: var(--ticket-gradient, linear-gradient(135deg, #C0A882, #E8D5B0));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── QR Code ─────────────────────────────────────────────────── */
.qr-wrap {
  background: white;
  border-radius: var(--radius);
  padding: 0.75rem;
  display: inline-block;
}

/* ── Entry status ────────────────────────────────────────────── */
.scan-result {
  padding: 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  animation: fadeInUp 0.4s ease both;
}

.scan-result.success {
  background: rgba(76,175,130,0.1);
  border: 1px solid rgba(76,175,130,0.3);
}

.scan-result.error {
  background: rgba(224,85,85,0.1);
  border: 1px solid rgba(224,85,85,0.3);
}

.scan-result .scan-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* ── Mobile hamburger ────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.25rem;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}
@media (max-width: 768px) { .hamburger { display: flex; margin-left: auto; } }

/* ── Utility ─────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }