/* ═══════════════════════════════════════════════════════════════════
   VitaraAfya — Consultation Room Styles
   Modern telemedicine video call UI (dark theme)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Base Dark Room ──────────────────────────────────────────────── */
.cr {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #0b0f14;
  color: #e4e8ee;
  font-family: var(--font-body, Inter, -apple-system, sans-serif);
  z-index: 100;
  overflow: hidden;
}

/* ── Video Area ──────────────────────────────────────────────────── */
.cr__video-wrap {
  position: relative;
  flex: 1;
  background: #000;
  overflow: hidden;
}

.cr__video-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Self-view PiP (bottom-right) */
.cr__selfview {
  position: absolute;
  bottom: 80px;
  right: 16px;
  width: 160px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
  background: #1a1f2e;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 10;
  cursor: grab;
  transition: box-shadow 0.2s;
}
.cr__selfview:hover { box-shadow: 0 6px 28px rgba(0,0,0,0.7); }
.cr__selfview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* Top bar overlay (provider name, timer, connection) */
.cr__topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, transparent 100%);
  z-index: 15;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.cr__topbar--hidden { opacity: 0; }
.cr__topbar > * { pointer-events: auto; }

.cr__provider-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cr__provider-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #1e293b;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; color: #00A876;
  overflow: hidden;
}
.cr__provider-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}

.cr__provider-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.cr__provider-specialty {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
}

.cr__session-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cr__timer {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,0.35);
  padding: 4px 10px;
  border-radius: 20px;
}

.cr__connection {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
}
.cr__connection-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
}
.cr__connection-dot--warn { background: #f59e0b; }
.cr__connection-dot--bad  { background: #ef4444; }

/* ── Floating Toolbar ────────────────────────────────────────────── */
.cr__toolbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 20;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.3s ease;
}
.cr__toolbar--hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.cr__btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.15rem;
  color: #fff;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
}
.cr__btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.08);
}
.cr__btn:active { transform: scale(0.95); }

.cr__btn--muted {
  background: rgba(239,68,68,0.25);
  color: #fca5a5;
}
.cr__btn--muted:hover {
  background: rgba(239,68,68,0.4);
}

.cr__btn--end {
  background: #dc2626;
  color: #fff;
  width: 56px; height: 48px;
  border-radius: 24px;
  font-size: 1.3rem;
  margin-left: 12px;
}
.cr__btn--end:hover {
  background: #b91c1c;
  transform: scale(1.08);
}

.cr__btn--active {
  background: rgba(0,168,118,0.35);
  color: #6ee7b7;
}

.cr__btn-label {
  display: none;
}

.cr__btn[title]::after {
  content: attr(title);
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.cr__btn:hover[title]::after { opacity: 1; }

/* ── Side Panels (Doctor Only) ───────────────────────────────────── */
.cr__panels {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  display: flex;
  z-index: 25;
  pointer-events: none;
}
.cr__panels > * { pointer-events: auto; }

/* Patient Info Panel */
.cr__patient-panel {
  width: 320px;
  background: rgba(15,20,30,0.95);
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 16px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.cr__patient-panel--open { transform: translateX(0); }

.cr__panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}

.cr__patient-card {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.cr__patient-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.cr__patient-meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 10px;
}

.cr__patient-section {
  margin-bottom: 10px;
}
.cr__patient-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}
.cr__patient-section p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.45;
  margin: 0;
}

.cr__quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.cr__quick-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.cr__quick-btn:hover {
  background: rgba(0,168,118,0.2);
  border-color: rgba(0,168,118,0.4);
  color: #6ee7b7;
}

/* SOAP Notes Panel */
.cr__notes-panel {
  width: 340px;
  background: rgba(15,20,30,0.95);
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.cr__notes-panel--open { transform: translateX(0); }

.cr__notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cr__notes-tabs {
  display: flex;
  gap: 2px;
}
.cr__notes-tab {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.cr__notes-tab--active {
  background: rgba(0,168,118,0.2);
  color: #6ee7b7;
}
.cr__notes-tab:hover:not(.cr__notes-tab--active) {
  color: rgba(255,255,255,0.8);
}

.cr__notes-body {
  flex: 1;
  padding: 14px 16px;
  overflow-y: auto;
}
.cr__notes-field {
  margin-bottom: 12px;
}
.cr__notes-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}
.cr__notes-field textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e4e8ee;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s;
}
.cr__notes-field textarea:focus {
  outline: none;
  border-color: rgba(0,168,118,0.5);
}
.cr__notes-field textarea::placeholder {
  color: rgba(255,255,255,0.25);
}

.cr__notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.cr__notes-status {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
}
.cr__notes-status--saved { color: #22c55e; }

.cr__notes-actions {
  display: flex;
  gap: 6px;
}
.cr__notes-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.cr__notes-btn:hover {
  background: rgba(0,168,118,0.2);
  border-color: rgba(0,168,118,0.4);
  color: #6ee7b7;
}
.cr__notes-btn--primary {
  background: #00A876;
  border-color: #00A876;
  color: #fff;
}
.cr__notes-btn--primary:hover {
  background: #009968;
}

/* ── Chat Panel ──────────────────────────────────────────────────── */
.cr__chat-panel {
  width: 340px;
  background: rgba(15,20,30,0.95);
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.cr__chat-panel--open { transform: translateX(0); }

.cr__chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cr__chat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}
.cr__chat-close {
  background: none; border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.2s;
}
.cr__chat-close:hover { color: #fff; }

.cr__chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr__chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  word-wrap: break-word;
}
.cr__chat-msg--sent {
  align-self: flex-end;
  background: #00A876;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.cr__chat-msg--received {
  align-self: flex-start;
  background: rgba(255,255,255,0.1);
  color: #e4e8ee;
  border-bottom-left-radius: 4px;
}
.cr__chat-msg--system {
  align-self: center;
  background: transparent;
  color: rgba(255,255,255,0.35);
  font-size: 0.72rem;
  font-style: italic;
}
.cr__chat-msg-time {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  margin-top: 3px;
}
.cr__chat-msg--sent .cr__chat-msg-time {
  color: rgba(255,255,255,0.6);
}

.cr__chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.cr__chat-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 8px 14px;
  color: #e4e8ee;
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  max-height: 80px;
}
.cr__chat-input:focus {
  outline: none;
  border-color: rgba(0,168,118,0.5);
}
.cr__chat-input::placeholder { color: rgba(255,255,255,0.3); }

.cr__chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: #00A876;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.cr__chat-send:hover { background: #009968; transform: scale(1.05); }
.cr__chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.cr__chat-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* ── Waiting Room ────────────────────────────────────────────────── */
.cr-wait {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b0f14 0%, #111827 50%, #0b0f14 100%);
  color: #e4e8ee;
  padding: 2rem;
  text-align: center;
}

.cr-wait__provider {
  margin-bottom: 2rem;
}
.cr-wait__avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: #1e293b;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 700; color: #00A876;
  border: 3px solid rgba(0,168,118,0.3);
  overflow: hidden;
}
.cr-wait__avatar img { width: 100%; height: 100%; object-fit: cover; }

.cr-wait__name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.cr-wait__specialty {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

.cr-wait__status {
  margin-bottom: 2rem;
}
.cr-wait__spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #00A876;
  border-radius: 50%;
  animation: crSpin 1s linear infinite;
  margin: 0 auto 16px;
}
@keyframes crSpin { to { transform: rotate(360deg); } }

.cr-wait__text {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 6px;
}
.cr-wait__subtext {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

.cr-wait__preview {
  width: 200px; height: 150px;
  border-radius: 12px;
  background: #1a1f2e;
  border: 2px solid rgba(255,255,255,0.08);
  overflow: hidden;
  margin: 0 auto 2rem;
}
.cr-wait__preview video {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.cr-wait__tips {
  max-width: 360px;
  margin: 0 auto;
}
.cr-wait__tips-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
}
.cr-wait__tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  text-align: left;
}
.cr-wait__tip-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(0,168,118,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── End Screen ──────────────────────────────────────────────────── */
.cr-end {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0b0f14;
  color: #e4e8ee;
  padding: 2rem;
  text-align: center;
}
.cr-end__icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(0,168,118,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}
.cr-end__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.cr-end__text {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2rem;
}
.cr-end__btn {
  padding: 10px 28px;
  border-radius: 10px;
  border: none;
  background: #00A876;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.cr-end__btn:hover { background: #009968; }

/* ── Consent & Recording ─────────────────────────────────────────── */
.cr-consent {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0f14;
  padding: 2rem;
}
.cr-consent__card {
  max-width: 480px;
  width: 100%;
  background: rgba(30,41,59,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 32px;
  color: #e4e8ee;
}
.cr-consent__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}
.cr-consent__text {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin-bottom: 20px;
}
.cr-consent__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
  cursor: pointer;
}
.cr-consent__check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: #00A876;
  margin-top: 2px;
  flex-shrink: 0;
}
.cr-consent__check span {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}
.cr-consent__actions {
  display: flex;
  gap: 10px;
}
.cr-consent__btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.cr-consent__btn--primary {
  background: #00A876;
  color: #fff;
}
.cr-consent__btn--primary:hover { background: #009968; }
.cr-consent__btn--primary:disabled { opacity: 0.4; cursor: not-allowed; }
.cr-consent__btn--outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
}
.cr-consent__btn--outline:hover {
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cr__selfview {
    width: 100px; height: 75px;
    bottom: 76px; right: 10px;
  }

  .cr__toolbar {
    padding: 10px 12px;
    gap: 4px;
  }
  .cr__btn {
    width: 42px; height: 42px;
    font-size: 1rem;
  }
  .cr__btn--end {
    width: 50px; height: 42px;
    margin-left: 8px;
  }

  .cr__patient-panel,
  .cr__notes-panel,
  .cr__chat-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    left: 0;
    width: 100%;
  }

  .cr__topbar {
    padding: 10px 14px;
  }
  .cr__provider-avatar {
    width: 32px; height: 32px;
    font-size: 0.9rem;
  }
  .cr__provider-name { font-size: 0.85rem; }
  .cr__timer { font-size: 0.78rem; padding: 3px 8px; }

  .cr-wait__avatar { width: 72px; height: 72px; font-size: 1.6rem; }
  .cr-wait__name { font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .cr__selfview {
    width: 80px; height: 60px;
    bottom: 68px; right: 8px;
  }
  .cr__btn { width: 38px; height: 38px; font-size: 0.95rem; }
  .cr__btn--end { width: 46px; height: 38px; }
}
