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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  width: 100%;
  min-height: 100vh;
  position: relative;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

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

/* Home Screen */
.home-container {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.home-container h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 40px;
}

.primary-btn, .secondary-btn {
  width: 100%;
  padding: 18px 30px;
  margin: 10px 0;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-btn {
  background: #ffffff;
  color: #667eea;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

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

.secondary-btn {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
  border: 2px solid rgba(255,255,255,0.3);
}

.secondary-btn:hover {
  background: rgba(255,255,255,0.3);
}

.btn-icon {
  font-size: 1.3rem;
}

/* Scanner Screen */
.scanner-container {
  text-align: center;
  max-width: 500px;
  width: 100%;
}

#qr-reader {
  margin: 20px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.scanner-container p {
  margin: 20px 0;
  font-size: 1rem;
  opacity: 0.9;
}

.cancel-btn {
  padding: 12px 30px;
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 20px;
  transition: all 0.2s ease;
}

.cancel-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Manual Entry Screen */
.manual-container {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.manual-container h2 {
  font-size: 1.8rem;
  margin-bottom: 30px;
}

#session-input {
  width: 100%;
  padding: 15px 20px;
  font-size: 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: white;
  margin-bottom: 20px;
  outline: none;
  transition: all 0.2s ease;
}

#session-input::placeholder {
  color: rgba(255,255,255,0.6);
}

#session-input:focus {
  border-color: #ffffff;
  background: rgba(255,255,255,0.15);
}

/* Casting Screen */
.casting-container {
  width: 100%;
  max-width: 600px;
}

#preview-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  background: #000;
}

#local-preview {
  width: 100%;
  display: block;
}

#preview-overlay {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 8px 15px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.casting-controls {
  margin-top: 20px;
  text-align: center;
}

.stop-btn {
  padding: 15px 40px;
  background: #ff3232;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 50, 50, 0.4);
}

.stop-btn:hover {
  background: #e62e2e;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 50, 50, 0.5);
}

/* Error Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  color: #333;
  padding: 30px;
  border-radius: 12px;
  max-width: 90%;
  width: 350px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #ff3232;
}

.modal-content p {
  margin-bottom: 25px;
  line-height: 1.5;
}

.modal-btn {
  padding: 12px 30px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-btn:hover {
  background: #5568d3;
}

/* Responsive */
@media (max-width: 480px) {
  .home-container h1 {
    font-size: 2rem;
  }
  
  .primary-btn, .secondary-btn {
    padding: 15px 25px;
    font-size: 1rem;
  }
}
