html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
  font-family: "Montserrat", sans-serif;
  color: white;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  overflow-y: auto;
}

.scanner-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  margin-bottom: 20px;
}

.title {
  font-size: 1.5em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fbbf24;
}

.subtitle {
  font-size: 0.9em;
  color: #d1d5db;
  margin-bottom: 25px;
}

#video {
  width: 100%;
  height: 300px;
  border-radius: 15px;
  background: #000;
  object-fit: cover;
  margin-bottom: 20px;
}

.scan-area {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.scan-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 3px solid #10b981;
  border-radius: 15px;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.scan-overlay::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 18px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.start-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 15px 30px;
  font-size: 1em;
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.start-btn:disabled {
  background: #6b7280;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.result {
  margin-top: 20px;
  padding: 15px;
  border-radius: 10px;
  font-size: 0.9em;
  display: none;
}

.result.success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.result.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}


.iframe-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
}

.back-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 20px;
  font-size: 1em;
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  margin: 0;
  width: 100%;
  text-align: center;
}

.back-button:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.content-frame {
  height: 60vh;
  border: none;
  width: 100%;
  background: white;
  border-radius: 10px;
  margin-bottom: 20px;
}

.iframe-debug {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 15px;
  color: white;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  max-height: 25vh;
  overflow-y: auto;
}

.iframe-debug .debug-title {
  font-weight: bold;
  margin-bottom: 10px;
  color: #fbbf24;
}

.register-section {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  margin-bottom: 20px;
  display: none;
  max-height: 80vh;
  overflow-y: auto;
}

.ticket-info {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: left;
  max-height: 300px;
  overflow-y: auto;
}

.ticket-info div {
  margin-bottom: 8px;
}

.register-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 15px 30px;
  font-size: 1.1em;
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px 5px;
  width: calc(100% - 10px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.register-btn:disabled {
  background: #6b7280;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.scan-again-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 15px 30px;
  font-size: 1em;
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px 5px;
  width: calc(100% - 10px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.scan-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.notification {
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  font-weight: 500;
  text-align: center;
  display: none;
}

.notification.success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.notification.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.notification.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

@media (max-width: 480px) {
  body {
    padding: 15px;
  }
  .scanner-container {
    padding: 20px 15px;
  }
  #video {
    height: 250px;
  }
  .scan-overlay {
    width: 150px;
    height: 150px;
  }
  .title {
    font-size: 1.3em;
  }
}