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

:root {
  --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #1e1b4b 100%);
  --admin-bg: #f8fafc;
  --glass-bg: rgba(17, 24, 39, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.12);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-family: 'Outfit', sans-serif;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================
   GLASSMORPHISM & COMMONS
   ========================================== */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.glow-text-primary {
  color: #a5b4fc;
  text-shadow: 0 0 15px var(--primary-glow);
}

.glow-text-success {
  color: #34d399;
  text-shadow: 0 0 15px var(--success-glow);
}

/* Button Premium Styles */
.btn-premium {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: var(--transition);
  text-decoration: none;
  font-size: 1rem;
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-premium:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   CLIENT MOBILE PAGE (/)
   ========================================== */
.client-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.logo-wrapper {
  margin-bottom: 30px;
  text-align: center;
}

.logo-wrapper img {
  max-width: 140px;
  max-height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.logo-fallback {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(to right, #6366f1, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-card {
  width: 100%;
  padding: 30px 24px;
  text-align: center;
}

.client-card h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.client-card p {
  color: var(--text-muted);
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 14px 16px;
  border-radius: 12px;
  color: white;
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.ticket-success-wrapper {
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ticket-badge {
  font-size: 4rem;
  font-weight: 800;
  margin: 20px 0;
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(16, 185, 129, 0.3));
}

/* ==========================================
   TV WAITROOM DISPLAY VIEW (/display)
   ========================================== */
.display-layout {
  display: grid;
  grid-template-columns: 35% 65%;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar - Attending & Queue (Left) */
.display-sidebar {
  border-right: 1px solid var(--glass-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.display-logo {
  height: 55px;
  max-width: 180px;
  object-fit: contain;
}

.clock-widget {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.current-ticket-card {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px 20px;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
}

.current-ticket-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.current-label {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.current-number {
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 5px 0;
  letter-spacing: -0.02em;
}

.current-box {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 10px;
}

/* Timer styles */
.timer-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  font-weight: 600;
}

.timer-dot {
  width: 10px;
  height: 10px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 1.5s infinite;
}

.timer-text {
  font-family: monospace;
  font-size: 1.1rem;
}

.timer-warning .timer-dot {
  background-color: var(--warning);
  box-shadow: 0 0 10px var(--warning);
}
.timer-warning .timer-text {
  color: var(--warning);
}

.timer-exceeded {
  animation: flashDanger 1s infinite alternate;
}
.timer-exceeded .timer-dot {
  background-color: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}
.timer-exceeded .timer-text {
  color: var(--danger);
}

/* Next Queue section */
.queue-widget {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 12px 15px;
}

.queue-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-weight: 600;
}

.queue-item .ticket {
  font-size: 1.1rem;
  color: #a5b4fc;
}

.queue-item .name {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Signage / Media Area (Right) */
.display-signage {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
}

.signage-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
}

.signage-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

.signage-slide.active {
  opacity: 1;
  visibility: visible;
}

/* Offer layout */
.slide-offer {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
}

.offer-badge {
  background: #f59e0b;
  color: #0b0f19;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 50px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.offer-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.offer-content {
  font-size: 1.6rem;
  color: var(--text-muted);
  max-width: 80%;
  line-height: 1.5;
  font-weight: 400;
}

.offer-image-container {
  margin-top: 30px;
  max-height: 40%;
  max-width: 90%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
}

.offer-image-container img {
  max-height: 300px;
  width: 100%;
  object-fit: cover;
}

/* Reflection layout */
.slide-reflection {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px;
  background: radial-gradient(circle at center, #311042 0%, #0b0f19 100%);
}

.reflection-icon {
  font-size: 3.5rem;
  color: #e9d5ff;
  margin-bottom: 25px;
  filter: drop-shadow(0 0 10px rgba(233, 213, 255, 0.4));
}

.reflection-text {
  font-size: 2.2rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.6;
  max-width: 85%;
  margin-bottom: 25px;
  color: #f3e8ff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.reflection-author {
  font-size: 1.2rem;
  font-weight: 600;
  color: #c084fc;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* YouTube layout */
.slide-youtube {
  width: 100%;
  height: 100%;
  background: #000;
}

.youtube-player-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.youtube-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Fullscreen Ticket Announcement Overlay */
.call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.95);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.call-overlay.active {
  opacity: 1;
  visibility: visible;
}

.call-dialog {
  width: 90%;
  max-width: 900px;
  padding: 60px 40px;
  text-align: center;
  animation: overlayPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 60px rgba(99, 102, 241, 0.4);
}

.overlay-bell {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: wiggle 0.5s ease-in-out infinite alternate;
}

.call-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 10px;
}

.call-number {
  font-size: 9rem;
  font-weight: 800;
  margin: 20px 0;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.call-box {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--success);
  text-shadow: 0 0 20px var(--success-glow);
}

/* ==========================================
   ADMIN PANEL & LOGIN VIEW (/admin, /admin/login)
   ========================================== */
body.admin-body {
  background: var(--admin-bg);
  color: #1e293b;
}

.admin-login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-gradient);
}

.admin-login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 30px;
  border-radius: 16px;
}

.admin-navbar {
  background: #0f172a;
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.admin-logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-logo-section img {
  height: 40px;
  max-width: 120px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 6px;
}

.admin-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-container {
  max-width: 1400px;
  margin: 30px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
}

/* Admin Sidebar Navigation */
.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  color: #475569;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  transition: var(--transition);
}

.admin-nav-item:hover, .admin-nav-item.active {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Dashboard Content Areas */
.admin-content-section {
  display: none;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-content-section.active {
  display: block;
}

.admin-section-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 20px;
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

/* Queue controller card layout */
.queue-operator-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.operator-box-select {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

.operator-control-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 30px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.operator-status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.status-free {
  background: #d1fae5;
  color: #065f46;
}

.status-busy {
  background: #fee2e2;
  color: #991b1b;
}

.operator-ticket-display {
  font-size: 4.5rem;
  font-weight: 800;
  margin: 15px 0;
  color: #0f172a;
}

.operator-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 25px;
}

/* Admin lists and tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  text-align: left;
}

.admin-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  padding: 12px 16px;
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

.admin-table tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-waiting { background: #dbeafe; color: #1e40af; }
.badge-attending { background: #fef3c7; color: #92400e; }
.badge-attended { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

.badge-simulado { background: #fae8ff; color: #86198f; }
.badge-enviado { background: #d1fae5; color: #065f46; }
.badge-fallido { background: #fee2e2; color: #991b1b; }

/* Grid for displaying digital signage items */
.signage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.signage-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  transition: var(--transition);
}

.signage-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.signage-card-body {
  padding: 20px;
}

.signage-card-type {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
}

.type-offer { background: #fef3c7; color: #d97706; }
.type-reflection { background: #f3e8ff; color: #8b5cf6; }
.type-youtube { background: #fee2e2; color: #dc2626; }

.signage-card-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #0f172a;
}

.signage-card-text {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 15px;
}

.signage-card-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #f1f5f9;
  padding: 10px 20px;
  background: #f8fafc;
}

.btn-danger-sm {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: var(--transition);
}

.btn-danger-sm:hover {
  background: #fca5a5;
  color: #991b1b;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

@keyframes flashDanger {
  0% { background-color: rgba(239, 68, 68, 0.1); }
  100% { background-color: rgba(239, 68, 68, 0.4); }
}

@keyframes scaleUp {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes overlayPop {
  0% { transform: scale(0.8) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes wiggle {
  0% { transform: rotate(-8deg); }
  100% { transform: rotate(8deg); }
}

/* ==========================================
   QR CODE DISPLAY SCREEN WIDGET
   ========================================== */
.qr-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: var(--transition);
}

.qr-widget:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.qr-container {
  background: white;
  padding: 5px;
  border-radius: 10px;
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qr-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.qr-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 4px;
}

.qr-url {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  word-break: break-all;
}
