:root {
  --bg: #0a0a0b;
  --bg2: #121214;
  --bg3: #1a1a1c;
  --accent: #FF2D2D;
  --accent-glow: rgba(255, 45, 45, 0.4);
  --text: #ffffff;
  --text2: #a0a0a0;
  --danger: #ff2d2d;
  --success: #00ff88;
  --font-display: 'Space Grotesk', 'Courier New', monospace;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --radius: 18px;
  --glass: rgba(18, 18, 20, 0.5);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 40px rgba(0,0,0,0.8);
  --hud-grid: radial-gradient(circle, #FF2D2D 0.5px, transparent 0.5px);
}
.hidden {
  display: none !important;
}

body.light-mode {
  --bg: #f2f2f5;
  --bg2: #ffffff;
  --bg3: #e8e8eb;
  --text: #1a1a1c;
  --text2: #5c5c63;
  --glass: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 45, 45, 0.15);
  --shadow: 0 10px 40px rgba(255, 45, 45, 0.08);
  --hud-grid: radial-gradient(circle, #FF2D2D 0.5px, transparent 0.5px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  user-select: none;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../icons/bg.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(8px) brightness(0.6);
  opacity: 0.5;
  z-index: -2;
  transition: opacity 0.5s;
}

body.light-mode::before {
  filter: blur(8px) brightness(1.1);
  opacity: 0.15;
}

/* Capa de Rejilla HUD */
.hud-background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
      var(--hud-grid),
      radial-gradient(circle at 50% 0%, rgba(255, 45, 45, 0.12) 0%, transparent 60%),
      radial-gradient(circle at 50% 100%, rgba(255, 45, 45, 0.06) 0%, transparent 60%);
  background-size: 30px 30px, 100% 100%, 100% 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.8;
}

/* Estilos de Iconos Feather */
.feather {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: middle;
}

.bottom-nav .nav-btn .icon {
  margin-bottom: 5px;
  width: 20px;
  height: 20px;
}

/* Efectos de Destellos (Sparkles) */
.sparkle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  background: radial-gradient(circle, rgba(255, 45, 45, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(2px);
  animation: float-glow 8s infinite ease-in-out;
  opacity: 0;
}

@keyframes float-glow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
  50% { transform: translate(20px, -40px) scale(1.5); opacity: 0.2; }
}

.container {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.view {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 90px;
}

/* Glassmorphism Panels */
.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Navegación Inferior (Premium HUD) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.nav-btn .icon {
  font-size: 20px;
  margin-bottom: 4px;
  filter: grayscale(1);
  opacity: 0.5;
  transition: all 0.3s;
}

.nav-btn .label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-btn.active .icon {
  filter: grayscale(0);
  opacity: 1;
  transform: translateY(-2px);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* HUD Typography helper */
.hud-font {
  font-family: var(--font-display);
  letter-spacing: 1px;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
}

/* Auth View Styles */
.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
  margin-top: 2rem;
}
.auth-header p {
  color: var(--accent);
  letter-spacing: 5px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 900;
  opacity: 0.8;
}

.auth-box {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text2);
  padding: 14px;
  font-weight: 900;
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
}

.auth-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Forms & Inputs */
input {
  background: var(--bg3);
  border: 1px solid #333;
  color: var(--text);
  padding: 12px 15px;
  border-radius: 8px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.3s;
}

input:focus {
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-weight: 900;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(255, 45, 45, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 0 25px rgba(255, 45, 45, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Modales Custom (v7.0) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg2);
    border: 1px solid var(--bg3);
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 10px 50px rgba(0,0,0,0.8);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #333;
    border: none;
    color: var(--text);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ticket Digital Style */
.ticket-digital {
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.ticket-header {
    background: var(--accent);
    color: var(--bg);
    padding: 25px 20px;
    text-align: center;
}

.ticket-header h2 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 3px;
    font-weight: 900;
}

.ticket-info {
    font-size: 0.65rem;
    margin-top: 8px;
    font-family: monospace;
    opacity: 0.8;
}

.ticket-body {
    padding: 25px 20px;
}

.ticket-section .label {
    font-size: 0.6rem;
    color: var(--accent);
    margin-bottom: 15px;
    display: block;
    letter-spacing: 1px;
}

.ticket-separator {
    border-top: 2px dashed #333;
    margin: 25px 0;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.ticket-row .label {
    color: var(--text2);
}

.ticket-row.total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.ticket-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.6rem;
    color: var(--text2);
    background: rgba(255, 215, 0, 0.03);
    border-top: 1px solid #222;
}

/* Timeline */
.timeline {
    padding-left: 15px;
    border-left: 1px solid #333;
    margin-left: 10px;
}

.timeline-item {
    position: relative;
    padding-left: 20px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Admin Mode: Crimson HUD (v7.0) */
#admin-view {
    background: linear-gradient(135deg, #1a0000 0%, #0a0a0a 100%);
    border-top: 2px solid #ff3333;
}

#admin-view h1.hud-font {
    color: #ff3333 !important;
    text-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

.admin-badge {
    background: #ff3333;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 900;
    margin-left: 10px;
    text-shadow: none;
    vertical-align: middle;
}

#admin-view .hud-item {
    border-color: #441111;
    background: rgba(40, 0, 0, 0.2);
}

#admin-view .hud-item .label {
    color: #cc6666;
}

#admin-view .history-section h2 {
    color: #ff3333 !important;
}

.btn-admin-action {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #888;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: monospace;
    font-weight: bold;
}

.btn-admin-action:hover {
    border-color: #ff3333;
    color: #ff3333;
}

.btn-admin-danger {
    border-color: #441111;
    color: #662222;
}

.btn-admin-danger:hover {
    background: #441111;
    color: #fff;
}

.btn-admin-primary {
    border-color: #ffd700;
    color: #ffd700;
}

.btn-admin-primary:hover {
    background: #ffd700;
    color: #000;
}

/* Share Button in Modal */
#btn-share-ticket {
    background: #25D366; /* WhatsApp Green */
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
