:root {
  --bg-primary: #f4f4f4;
  --bg-secondary: #e9e9e9;
  --accent-gold: #bbb;
  --accent-light: #ddd;
  --text-light: #222;
  --text-mid: #555;
  --text-dark: #484848;
  --shadow-md: rgba(0, 0, 0, 0.1);
}

/* ── FONTS ───────────────────────────────── */
@font-face { font-family: 'Radjhani_L'; src: url('./Font_Faces/Rajdhani-Light.ttf'); }
@font-face { font-family: 'Radjhani_SB'; src: url('./Font_Faces/Rajdhani-SemiBold.ttf'); }
@font-face { font-family: 'Radjhani_B'; src: url('./Font_Faces/Rajdhani-Bold.ttf'); }
@font-face { font-family: 'Radjhani';   src: url('./Font_Faces/Rajdhani-Regular.ttf'); }

/* ── BASE ────────────────────────────────── */
* {
  box-sizing: border-box;
  transition: all 0.3s ease;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Radjhani', sans-serif;
  background: var(--bg-primary);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOP CONTROLS ────────────────────────── */
.control_panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 3rem;
  background: var(--bg-secondary);
  box-shadow: 0 2px 6px var(--shadow-md);
}

.control_left {
  flex: 1;
}

.control_panel .heading h1 {
  margin: 0;
  font-family: 'Radjhani_L';
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  color: var(--text-dark);
}

.control_right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.control_right input#ref {
  font-family: monospace;
  padding: 0.6rem 1rem;
  background: #fff;
  border: 1px solid var(--accent-gold);
  border-radius: 0.5rem;
  color: var(--text-light);
}

.control_right button {
  padding: 0.6rem 1.5rem;
  background: var(--accent-light);
  border: 1px solid var(--accent-gold);
  border-radius: 0.5rem;
  font-family: 'Radjhani_B';
  font-size: 1rem;
  color: var(--text-dark);
  cursor: pointer;
}
.control_right button:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

/* ── TICKET PREVIEW ───────────────────────── */
.preview {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: var(--bg-primary);
}

/* ── TICKET CARD ─────────────────────────── */
#ticketBox {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-gold);
  border-radius: 1rem;
  box-shadow: 0 4px 10px var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

/* ── QR FRAME ────────────────────────────── */
.qrContainer {
  position: relative;
  width: 300px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border-radius: 12px;
}

#qrcode {
  width: 200px;
  height: 200px;
  background-color: #fff;
  border: 1px solid var(--accent-gold);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qrcode canvas {
  width: 100% !important;
  height: 100% !important;
  background: #fff !important;
}

/* ── DIVIDER LINE ────────────────────────── */
hr.divider {
  width: 80%;
  height: 1px;
  background: var(--accent-gold);
  border: none;
  margin: 1rem 0;
  opacity: 0.3;
}

/* ── TICKET INFO ─────────────────────────── */
.Info_Space {
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  color: var(--text-mid);
  letter-spacing: 0.5px;
}

.Info_Space p#code {
  font-family: 'Radjhani_SB';
  font-size: clamp(4rem,4vw,1.6rem);
  margin: 0%;
  
  font-style: italic;
  color: var(--text-light);
}

.Info_Space h2#name {
  font-family: 'Radjhani_L';
  font-size: clamp(1.4rem,4vw,1.8rem);
  margin: 0.5rem 0;
}

.Info_Space #number,
.Info_Space #email,
.Info_Space .venue {
  font-size: clamp(1rem,2.5vw,1.1rem);
  margin: 0.25rem 0;
}

/* ── TICKET TYPE ─────────────────────────── */
#tictype {
  font-family: 'Radjhani_B';
  font-size: clamp(2.4rem,7vw,3.2rem);
  margin-top: 1rem;
  color: var(--text-dark);
  text-shadow: none;
}

/* ── PURCHASE INFO ───────────────────────── */
.Info_Space p#purch {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-top: 0.75rem;
}

@keyframes goldAnim {
  0%   { background-position:   0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position:   0% 50%; }
}

@keyframes holoAnim {
  0%   { background-position:   0%   0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position:   0%   0%; }
}

/* ── RESPONSIVE TWEAKS ───────────────────── */
@media (max-width: 768px) {
  .control_panel {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  #ticketBox {
    max-width: 90%;
    padding: 1rem;
  }

  .qrContainer, #qrcode {
    width: 200px;
    height: 200px;
  }

  #tictype {
    font-size: clamp(1.8rem,8vw,2.8rem);
  }

  .Info_Space p#code {
  font-family: 'Radjhani_SB';
  font-size: clamp(2rem,4vw,1.6rem);
  margin: 0%;
  margin-top: 10px;
  font-style: italic;
  color: var(--text-light);
}

.control_right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}
}

/* ── POPUP STYLES ───────────────────────── */
.popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  border: 1px solid var(--accent-gold);
  box-shadow: 0 4px 12px var(--shadow-md);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  display: none;
  z-index: 9999;
  width: 280px;
  text-align: center;
}

.popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.popup-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  line-height: 48px;
  margin-bottom: 0.5rem;
}

/* spinner state */
.popup-icon.load {
  border: 4px solid rgba(255,255,255,0.3);
  border-top: 4px solid var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* success state */
.popup-icon.success {
  color: rgb(255, 245, 47);
  animation: pop 0.4s ease-out both;
}
.popup-icon.success::before { content: "✔"; }

/* error state */
.popup-icon.error {
  color: #f44336;
  animation: pop 0.4s ease-out both;
}
.popup-icon.error::before { content: "✕"; }

/* text */
#popup-message {
  margin: 0;
  color: var(--text-light);
  font-family: 'Radjhani', sans-serif;
  font-size: 0.9rem;
}

/* animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
