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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #e94560;
  --accent-hover: #ff6b6b;
  --success: #4ecca3;
  --border-radius: 12px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.app {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

/* Login Panel */
.login-panel {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--border-radius);
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-card h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-card .subtitle {
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

#join-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#password-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  text-align: center;
  transition: border-color 0.2s ease;
}

#password-input:focus {
  outline: none;
  border-color: var(--accent);
}

#password-input::placeholder {
  color: var(--text-secondary);
}

#join-btn {
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

#join-btn:hover {
  background: var(--accent-hover);
}

#join-btn:active {
  transform: scale(0.98);
}

#join-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-text {
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 24px;
}

.status-text.error {
  color: var(--accent);
}

.status-text.success {
  color: var(--success);
}

/* Video Panel */
.video-panel {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
}

#remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  transition: opacity 0.3s ease;
}

.video-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.video-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-panel:hover .video-controls {
  opacity: 1;
}

.video-controls button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  backdrop-filter: blur(10px);
}

.video-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.video-controls button svg {
  width: 24px;
  height: 24px;
}

#disconnect-btn:hover {
  background: var(--accent);
}

/* Fullscreen styles */
.video-panel:fullscreen {
  background: #000;
}

.video-panel:fullscreen .video-controls {
  bottom: 40px;
  right: 40px;
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 30px 20px;
  }

  .login-card h1 {
    font-size: 1.5rem;
  }
}
