/* Full Mobile Screen WebRTC VR Telemedicine Interface */
:root {
  --bg-dark: #090d16;
  --bg-card: #151d30;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

.screen-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Screen 1: Start Room Screen */
#startScreen {
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 30%, #1a243a 0%, #090d16 100%);
  overflow-y: auto;
}

.start-card {
  width: 100%;
  max-width: 420px;
  background: rgba(21, 29, 48, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #000;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.start-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--text-sub);
  text-align: center;
  margin-top: -0.5rem;
}

/* Role Tabs Switcher */
.role-tabs {
  width: 100%;
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.role-tab {
  flex: 1;
  padding: 0.6rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-sub);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.role-tab.active {
  background: #1e2942;
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.role-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-sub);
  text-align: center;
  line-height: 1.3;
}

.form-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent-cyan);
}

.input-with-btn {
  display: flex;
  gap: 0.5rem;
}

.input-with-btn input {
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.btn-icon {
  padding: 0 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
}

.expiry-info {
  font-size: 0.7rem;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.btn {
  padding: 0.85rem 1.4rem;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn:active {
  transform: scale(0.98);
}

/* Screen 2: Full Screen Mobile Video Call View */
#callScreen {
  position: relative;
  background: #000;
}

.vr-stream-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Background Full Screen Video */
.vr-video-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050811;
}

.vr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  z-index: 5;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

/* Top Overlay Bar */
.top-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
}

.room-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: monospace;
  font-weight: 700;
  font-size: 0.85rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

.pill-btn {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Floating PiP Thumbnail */
.floating-pip {
  position: absolute;
  top: 4.25rem;
  left: 1rem;
  width: 110px;
  height: 155px;
  background: #111;
  border: 2px solid var(--accent-cyan);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  z-index: 25;
}

.floating-pip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pip-label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 0.65rem;
  text-align: center;
  border-radius: 4px;
  padding: 1px 0;
}

/* Bottom Controls Bar */
.bottom-controls {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.25rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  padding: 0.75rem 1.5rem;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 30;
}

.control-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.control-btn:active {
  transform: scale(0.92);
}

.control-btn.off {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.btn-end {
  background: var(--accent-rose);
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
}
