/* ══════════════════════════════════════════════════════════════════════
   Rajasthan Diwas — Custom Styles
   Premium design tokens & animations on top of Tailwind CDN
   ══════════════════════════════════════════════════════════════════════ */

/* ── Google Font ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --rj-gold:       #d4a742;
  --rj-gold-light: #f0d078;
  --rj-saffron:    #f05a28;
  --rj-crimson:    #c6173d;
  --rj-teal:       #0d9488;
  --rj-navy:       #0f172a;
  --rj-dark:       #0b0e14;
  --rj-card:       rgba(15, 23, 42, 0.65);
  --rj-glass:      rgba(255, 255, 255, 0.06);
  --rj-border:     rgba(212, 167, 66, 0.25);
  --rj-success:    #22c55e;
  --rj-danger:     #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--rj-dark);
  color: #e2e8f0;
  min-height: 100vh;
}

/* ── Animated gradient background ────────────────────────────────────── */
.bg-gradient-animated {
  background: linear-gradient(135deg, #0b0e14 0%, #1a0a1e 25%, #0f172a 50%, #1a0520 75%, #0b0e14 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Glassmorphism card ──────────────────────────────────────────────── */
.glass-card {
  background: var(--rj-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--rj-border);
  border-radius: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Fancy input ─────────────────────────────────────────────────────── */
.rj-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #f1f5f9;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  outline: none;
}
.rj-input:focus {
  border-color: var(--rj-gold);
  box-shadow: 0 0 0 3px rgba(212, 167, 66, 0.15);
  background: rgba(255, 255, 255, 0.06);
}
.rj-input::placeholder { color: rgba(255, 255, 255, 0.3); }

/* ── Label ───────────────────────────────────────────────────────────── */
.rj-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--rj-gold-light);
  letter-spacing: 0.025em;
}

/* ── Primary button ──────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #0b0e14;
  background: linear-gradient(135deg, var(--rj-gold) 0%, var(--rj-gold-light) 100%);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  letter-spacing: 0.03em;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 167, 66, 0.35);
  filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Upload zone ─────────────────────────────────────────────────────── */
.upload-zone {
  position: relative;
  border: 2px dashed rgba(212, 167, 66, 0.35);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.3s, background 0.3s;
  background: rgba(255, 255, 255, 0.02);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--rj-gold);
  background: rgba(212, 167, 66, 0.06);
}
.upload-zone .icon { font-size: 2rem; margin-bottom: 0.25rem; }
.upload-zone .label { color: rgba(255, 255, 255, 0.5); font-size: 0.9rem; }
.upload-zone .filename {
  margin-top: 0.5rem;
  color: var(--rj-gold-light);
  font-weight: 500;
  font-size: 0.85rem;
}

/* ── Upload buttons (Browse / Camera) ────────────────────────────────── */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}
.upload-btn:hover {
  background: rgba(212, 167, 66, 0.15);
  border-color: var(--rj-gold);
  transform: translateY(-1px);
}

/* ── Alert / toast ───────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
  animation: fadeSlideIn 0.3s ease;
}
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* ── QR ticket result ────────────────────────────────────────────────── */
.ticket-card {
  text-align: center;
  padding: 2rem;
  animation: fadeSlideIn 0.5s ease;
}
.ticket-card img {
  width: 220px;
  height: 220px;
  border-radius: 1rem;
  border: 3px solid var(--rj-gold);
  margin: 1rem auto;
  box-shadow: 0 0 30px rgba(212, 167, 66, 0.25);
}

/* ── Scanner flash overlays ──────────────────────────────────────────── */
.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  animation: flashIn 0.3s ease;
}
.flash-red {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.95), rgba(185, 28, 28, 0.98));
}
.flash-green {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.95), rgba(21, 128, 61, 0.98));
}
.flash-overlay h1 {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  margin-bottom: 0.5rem;
}
.flash-overlay p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  max-width: 340px;
}
.flash-overlay .icon-big {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* ── Confirm entry button ────────────────────────────────────────────── */
.btn-confirm {
  margin-top: 1.5rem;
  padding: 1rem 2.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}
.btn-confirm:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(22, 163, 74, 0.4);
}

.btn-dismiss {
  margin-top: 1rem;
  padding: 0.7rem 2rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-dismiss:hover { background: rgba(255,255,255,0.25); }

/* ── ID Photo in scanner ─────────────────────────────────────────────── */
.id-photo-preview {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 1rem;
  border: 3px solid rgba(255,255,255,0.3);
  margin: 1rem auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ── Spinner ──────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(0,0,0,0.15);
  border-top-color: #0b0e14;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Decorative elements ─────────────────────────────────────────────── */
.ornament {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rj-gold), transparent);
  margin: 0.75rem auto;
}

/* ── Scanner container ───────────────────────────────────────────────── */
#qr-reader {
  border-radius: 1rem;
  overflow: hidden;
}
#qr-reader video { border-radius: 1rem; }

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes flashIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .glass-card { padding: 1.25rem !important; }
  .flash-overlay h1 { font-size: 1.5rem; }
  .id-photo-preview { width: 140px; height: 140px; }
}
