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

:root {
  --bg-primary: #040406;
  --bg-secondary: #0a0a0f;
  --bg-card: rgba(10, 10, 15, 0.65);
  --color-unhas-red: #9e0c0c;
  --color-unhas-red-glow: rgba(158, 12, 12, 0.7);
  --color-unhas-gold: #ffc800;
  --color-unhas-gold-glow: rgba(255, 200, 0, 0.6);
  --color-neon-blue: #00f0ff;
  --color-neon-blue-glow: rgba(0, 240, 255, 0.4);
  --text-primary: #ffffff;
  --text-secondary: #8f92a3;
  --border-glow: rgba(255, 255, 255, 0.05);
  --border-neon: rgba(255, 200, 0, 0.15);
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Ambient Nebula Background */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -3;
  background: var(--bg-primary);
  overflow: hidden;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  mix-blend-mode: screen;
  pointer-events: none;
}

.aurora-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-unhas-red) 0%, transparent 80%);
  top: -10%;
  left: -10%;
  animation: float-slow 25s ease-in-out infinite alternate;
}

.aurora-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--color-unhas-gold) 0%, transparent 80%);
  bottom: -20%;
  right: -10%;
  animation: float-slow 30s ease-in-out infinite alternate-reverse;
}

.aurora-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-neon-blue) 0%, transparent 80%);
  top: 40%;
  left: 50%;
  opacity: 0.06;
  animation: float-slow 20s ease-in-out infinite alternate;
}

.particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* Scanlines overlay for tech feel */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 4px, 6px 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

/* Glassmorphism Common Styles */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-glow);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
  pointer-events: none;
}

/* Interactive Card Portal Page */
.portal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  text-align: center;
}

.portal-header {
  margin-bottom: 50px;
}

.portal-logo-unhas {
  width: 110px;
  margin-bottom: 25px;
  filter: drop-shadow(0 0 25px var(--color-unhas-gold-glow));
  animation: float-logo 5s ease-in-out infinite;
}

.portal-title {
  font-size: 3.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 40%, var(--color-unhas-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  letter-spacing: 2px;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.portal-subtitle {
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.portal-cards {
  display: flex;
  gap: 35px;
  width: 100%;
  max-width: 950px;
  margin-top: 25px;
}

.portal-card {
  flex: 1;
  padding: 45px 35px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.portal-card:hover {
  transform: translateY(-12px);
  border-color: var(--color-unhas-gold-glow);
  box-shadow: 0 30px 60px rgba(255, 200, 0, 0.12);
  background: rgba(15, 15, 22, 0.85);
}

.portal-card.camera-card:hover {
  border-color: var(--color-unhas-red-glow);
  box-shadow: 0 30px 60px rgba(158, 12, 12, 0.25);
}

.card-icon {
  font-size: 3.2rem;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-card:hover .card-icon {
  transform: scale(1.15) rotate(5deg);
  background: rgba(255, 255, 255, 0.06);
}

.card-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 15px;
  letter-spacing: 0.5px;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 300;
}

/* Stage Screen layout (Full HD optimized) */
.stage-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  padding: 30px;
  gap: 30px;
}

.stage-main {
  flex: 3;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--border-neon);
  box-shadow: 0 0 30px rgba(255, 200, 0, 0.03), inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stage-title-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stage-logo-unhas {
  height: 65px;
  filter: drop-shadow(0 0 15px var(--color-unhas-gold-glow));
  animation: float-logo 4s ease-in-out infinite;
}

.stage-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffffff 40%, var(--color-unhas-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stage-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 4px;
  font-weight: 500;
}

/* Digital clock */
.header-clock-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-main);
}

.header-time {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.header-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.canvas-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

#mosaicCanvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(158, 12, 12, 0.15));
}

/* Stage Sidebar / Stats Panel */
.stage-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 440px;
}

/* Holographic Stat Box */
.stat-box {
  padding: 30px;
  text-align: center;
  border: 1px solid rgba(255, 200, 0, 0.1);
  background: linear-gradient(180deg, rgba(255, 200, 0, 0.02) 0%, transparent 100%), var(--bg-card);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 200, 0, 0.02);
}

.stat-label {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 600;
}

.stat-number {
  font-size: 5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #ffffff 30%, var(--color-unhas-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px var(--color-unhas-gold-glow));
  line-height: 1.1;
  margin-bottom: 15px;
}

/* Advanced Stats Layout */
.stat-extra-info {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 15px;
  gap: 15px;
}

.stat-subitem {
  flex: 1;
  text-align: left;
}

.stat-subitem.right-align {
  text-align: right;
}

.stat-sub-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.stat-sub-value {
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-unhas-red) 0%, var(--color-unhas-gold) 100%);
  box-shadow: 0 0 8px var(--color-unhas-gold-glow);
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Recent Attendees panel */
.recent-welcome-panel {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.panel-header {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.5px;
}

.panel-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
}

.recent-attendees {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
  padding-right: 5px;
}

/* Scrollbar styling */
.recent-attendees::-webkit-scrollbar {
  width: 5px;
}

.recent-attendees::-webkit-scrollbar-track {
  background: transparent;
}

.recent-attendees::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.recent-attendees::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 200, 0, 0.2);
}

.attendee-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
  animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.attendee-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 200, 0, 0.15);
}

.attendee-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-unhas-gold);
  box-shadow: 0 0 15px rgba(255, 200, 0, 0.25);
}

.attendee-info {
  flex: 1;
}

.attendee-welcome {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.attendee-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 400;
}

/* Holographic Welcome Overlay Popup for Stage view */
.welcome-popup-overlay {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 360px;
  padding: 30px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 1000;
  transform: translateX(420px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--color-unhas-gold);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 200, 0, 0.1);
  background: rgba(10, 10, 15, 0.9);
}

.welcome-popup-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-unhas-red) 0%, var(--color-unhas-gold) 100%);
}

.welcome-popup-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-unhas-gold);
  box-shadow: 0 0 25px var(--color-unhas-gold-glow);
  margin-bottom: 20px;
}

.welcome-popup-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-unhas-gold);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
}

.welcome-popup-subtitle {
  font-size: 1rem;
  color: #ffffff;
  font-weight: 500;
}

/* Admin controls panel */
.admin-bar {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.5px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-reset {
  background: rgba(158, 12, 12, 0.15);
  border-color: rgba(158, 12, 12, 0.25);
  color: #ff9d9d;
  box-shadow: 0 4px 15px rgba(158, 12, 12, 0.05);
}

.btn-reset:hover {
  background: rgba(158, 12, 12, 0.3);
  border-color: var(--color-unhas-red);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(158, 12, 12, 0.2);
}

/* Camera App layout styling */
.camera-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 30px;
  align-items: center;
  justify-content: center;
  max-width: 1050px;
  margin: 0 auto;
  width: 100%;
}

.camera-header {
  text-align: center;
  margin-bottom: 30px;
}

.camera-container-box {
  width: 100%;
  position: relative;
  aspect-ratio: 4/3;
  max-height: 60vh;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
}

.camera-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 25px;
  padding: 18px 30px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ff453a;
  animation: pulse-dot 1.5s infinite;
}

.status-dot.active {
  background-color: #30d158;
}

.status-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.camera-info-banner {
  margin-top: 20px;
  font-size: 1rem;
  color: var(--color-unhas-gold);
  text-align: center;
  font-weight: 500;
  opacity: 0.8;
  animation: breath-glow 2s ease-in-out infinite;
}

/* Flash effect */
.flash-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

/* Animations */
@keyframes float-slow {
  0% { transform: translate(0px, 0px) scale(1); }
  50% { transform: translate(40px, -50px) scale(1.1); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes float-logo {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

@keyframes breath-glow {
  0% { opacity: 0.6; text-shadow: 0 0 5px rgba(255, 200, 0, 0); }
  50% { opacity: 1; text-shadow: 0 0 10px rgba(255, 200, 0, 0.4); }
  100% { opacity: 0.6; text-shadow: 0 0 5px rgba(255, 200, 0, 0); }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(25px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive constraints */
@media (max-width: 1024px) {
  .portal-cards {
    flex-direction: column;
    gap: 20px;
  }
  
  .stage-layout {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }
  
  .stage-sidebar {
    max-width: 100%;
  }
  
  .canvas-container {
    min-height: 500px;
  }
}

/* Custom Confirm Modal */
.confirm-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.confirm-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal-box {
  width: 100%;
  max-width: 440px;
  padding: 30px;
  border: 1px solid var(--color-unhas-red);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 30px rgba(158, 12, 12, 0.2);
  text-align: left;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-modal-backdrop.active .confirm-modal-box {
  transform: translateY(0);
}

.confirm-modal-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Password Protection Login Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 4, 6, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.login-box {
  width: 90%;
  max-width: 420px;
  padding: 45px 35px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
}

.password-input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
  letter-spacing: 2px;
}

.password-input:focus {
  border-color: var(--color-unhas-gold);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 15px rgba(255, 200, 0, 0.15);
}

.btn-login {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-unhas-red) 0%, #d81b1b 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(158, 12, 12, 0.2);
}

.btn-login:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #b50e0e 0%, #f22929 100%);
  box-shadow: 0 6px 20px rgba(158, 12, 12, 0.4);
}

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

/* Shake Animation for Password Error */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.password-input.error-shake {
  border-color: #ff4d4d;
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.2);
  animation: shake 0.4s ease-in-out;
}

