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

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

/* 랜딩 페이지 */
.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  text-align: center;
  margin-bottom: 60px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.logo h1 {
  font-size: 2.5rem;
  color: white;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.tagline {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
}

.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.mode-card {
  background: white;
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
}

.mode-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  border-color: #4F46E5;
}

.mode-icon {
  margin-bottom: 20px;
}

.mode-card h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #1a1a2e;
}

.mode-card p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 24px;
}

.mode-btn {
  display: inline-block;
  background: #4F46E5;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s;
}

.mode-btn.green {
  background: #16A34A;
}

.mode-btn:hover {
  opacity: 0.9;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  text-align: center;
}

.feature {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 30px 20px;
  color: white;
}

.feature-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.feature p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 인증 페이지 */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #1a1a2e;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #4F46E5;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: #4F46E5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: #4338CA;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: #666;
}

.auth-switch a {
  color: #4F46E5;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.error-message {
  background: #FEE2E2;
  color: #DC2626;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
}

.error-message.show {
  display: block;
}

/* 호스트/클라이언트 공통 */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-header .logo {
  margin: 0;
}

.app-header .logo h1 {
  font-size: 1.5rem;
  color: #1a1a2e;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
  font-weight: 500;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #4F46E5;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.btn-logout {
  padding: 8px 16px;
  background: #FEE2E2;
  color: #DC2626;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s;
}

.btn-logout:hover {
  background: #FECACA;
}

.app-content {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 호스트 페이지 */
.host-container {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.host-status {
  background: white;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
  margin-bottom: 16px;
}

.status-indicator.offline {
  background: #FEE2E2;
  color: #DC2626;
}

.status-indicator.online {
  background: #DCFCE7;
  color: #16A34A;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

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

.session-code {
  font-size: 2.5rem;
  font-weight: 700;
  color: #4F46E5;
  letter-spacing: 4px;
  margin: 20px 0;
  font-family: 'Courier New', monospace;
}

.session-info {
  color: #666;
  margin-bottom: 20px;
}

.btn-start {
  padding: 14px 32px;
  background: #4F46E5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-start:hover {
  background: #4338CA;
  transform: translateY(-2px);
}

.btn-start:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* 클라이언트 페이지 */
.client-container {
  width: 100%;
  max-width: 1200px;
}

.connection-form {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  margin: 0 auto;
}

.connection-form h2 {
  margin-bottom: 20px;
  text-align: center;
}

.remote-screen {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.remote-screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 1.2rem;
  z-index: 10;
}

.connection-status {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-status .status-dot {
  width: 8px;
  height: 8px;
}

.connection-status.connected {
  background: rgba(22, 163, 74, 0.9);
}

.connection-status.connecting {
  background: rgba(234, 179, 8, 0.9);
}

.connection-status.disconnected {
  background: rgba(220, 38, 38, 0.9);
}

.control-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.control-btn {
  padding: 10px 20px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn:hover {
  border-color: #4F46E5;
  color: #4F46E5;
}

.control-btn.active {
  background: #4F46E5;
  color: white;
  border-color: #4F46E5;
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 로딩 스피너 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 토스트 알림 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: white;
  border-radius: 8px;
  padding: 12px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast.success {
  border-left: 4px solid #16A34A;
}

.toast.error {
  border-left: 4px solid #DC2626;
}

.toast.info {
  border-left: 4px solid #4F46E5;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 반응형 */
@media (max-width: 768px) {
  .mode-cards {
    grid-template-columns: 1fr;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .app-header {
    padding: 12px 16px;
  }
  
  .app-content {
    padding: 16px;
  }
  
  .session-code {
    font-size: 1.8rem;
  }
}