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

:root {
  --bg-color: #060713;
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-glow: rgba(99, 102, 241, 0.15);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  
  --primary-color: #6366f1;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Glowing Bubbles */
body::before, body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  z-index: -1;
  filter: blur(120px);
  opacity: 0.4;
  pointer-events: none;
}

body::before {
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
  top: -10%;
  left: -10%;
  animation: float-slow 20s infinite alternate;
}

body::after {
  background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
  bottom: -10%;
  right: -10%;
  animation: float-slow 25s infinite alternate-reverse;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.2); }
}

/* Glassmorphism Container */
.container {
  width: 90%;
  max-width: 480px;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-gradient);
}

/* Typography */
h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

p.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* Forms */
.form-group {
  text-align: left;
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"], select {
  width: 100%;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all 0.3s ease;
}

input[type="text"]:focus, select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

select option {
  background-color: #0c0e1e;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 1.1rem;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--secondary-gradient);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}
.btn-secondary:hover {
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

.btn-danger {
  background: var(--danger-gradient);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

/* Ticket Display Card */
.ticket-card {
  margin: 2rem 0;
  padding: 2.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.ticket-number {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  background: var(--secondary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.5rem 0;
  letter-spacing: -2px;
}

.ticket-name {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.ticket-location {
  font-size: 0.95rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  display: inline-block;
  margin-top: 0.5rem;
}

/* Queue Info List */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  font-weight: 700;
  color: var(--text-primary);
}

.info-value.highlight {
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* Fullscreen Overlay "Called" State */
.called-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 7, 19, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.called-overlay.active {
  opacity: 1;
  pointer-events: all;
  animation: pulse-border 2s infinite alternate;
}

@keyframes pulse-border {
  0% { box-shadow: inset 0 0 30px rgba(99, 102, 241, 0.3); }
  100% { box-shadow: inset 0 0 80px rgba(168, 85, 247, 0.6); }
}

.called-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--success-color);
  text-transform: uppercase;
  margin-bottom: 1rem;
  letter-spacing: 2px;
  animation: pulse-text 1.5s infinite alternate;
}

@keyframes pulse-text {
  0% { transform: scale(0.95); filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(16, 185, 129, 0.8)); }
}

.called-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

/* --- Admin Panel Layout --- */
.admin-layout {
  width: 95%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0;
}

@media(min-width: 992px) {
  .admin-layout {
    grid-template-columns: 320px 1fr;
  }
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 0.2rem;
  font-weight: 600;
}

/* Admin queue list */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 550px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.queue-list::-webkit-scrollbar {
  width: 6px;
}
.queue-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
.queue-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.item-number {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--secondary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 60px;
  text-align: center;
}

.item-info {
  display: flex;
  flex-direction: column;
}

.item-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.item-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.item-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s ease;
}

.action-btn:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.action-btn.btn-call {
  background: var(--success-gradient);
}
.action-btn.btn-complete {
  background: var(--primary-gradient);
}
.action-btn.btn-absent {
  background: var(--danger-gradient);
}

/* Empty Queue State */
.empty-state {
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- TV Panel View (/painel) --- */
.painel-grid {
  width: 95vw;
  height: 90vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 1rem;
}

@media(min-width: 992px) {
  .painel-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}

.painel-main {
  background: var(--panel-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.7);
  border-radius: var(--radius-lg);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  animation: main-card-glow 6s infinite alternate;
}

@keyframes main-card-glow {
  0% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.15); }
  100% { box-shadow: 0 0 80px rgba(6, 182, 212, 0.3); }
}

.painel-main-label {
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 6px;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.painel-main-number {
  font-size: 12rem;
  font-weight: 900;
  line-height: 0.9;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 15px 30px rgba(99, 102, 241, 0.4));
  margin-bottom: 2rem;
  animation: scale-pulse 2s infinite alternate;
}

@keyframes scale-pulse {
  0% { transform: scale(0.98); }
  100% { transform: scale(1.02); }
}

.painel-main-name {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.painel-main-location {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 2.5rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.painel-history {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}

.painel-history-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.8rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  flex: 1;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  animation: slide-in 0.5s ease-out;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.history-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-right: 1.5rem;
  min-width: 90px;
  background: var(--secondary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.history-info {
  text-align: left;
  display: flex;
  flex-direction: column;
}

.history-name {
  font-size: 1.4rem;
  font-weight: 700;
}

.history-location {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

/* Authentication Login Modal/Card */
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
}

.error-message {
  color: var(--danger-color);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Footer styling */
footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
footer a {
  color: var(--text-secondary);
  text-decoration: none;
}
footer a:hover {
  color: var(--primary-color);
}
