/* ============================================================
   css/video.css — Video Call Specific UI
   ============================================================ */

/* ── Global reset for video pages ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: #94a3b8; font-size: 0.875rem; }

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
  color: inherit;
}

input, select {
  font: inherit;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: #e2e8f0;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, select:focus { border-color: #3b82f6; }
input::placeholder { color: #64748b; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0.75rem 0 0.25rem;
  color: #cbd5e1;
}

/* ── Layout wrapper ── */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
}

/* ── Call header ── */
.call-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0 1.25rem;
}
.call-header h1, .call-header h2 {
  font-size: 1.35rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.call-header h1 i, .call-header h2 i { color: #3b82f6; }
.back-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
}
.back-link:hover { color: #e2e8f0; }

/* ── Lobby grid ── */
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}
.lobby-card {
  background: #1e293b;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s;
}
.lobby-card:hover { border-color: #475569; }
.lobby-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #f1f5f9;
}
.lobby-card h2 i { color: #3b82f6; font-size: 1rem; }
.lobby-card-wide { grid-column: 1 / -1; }

/* ── Buttons ── */
.call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  background: #334155;
  color: #e2e8f0;
  transition: background 0.2s, transform 0.1s;
  border: none;
  cursor: pointer;
}
.call-btn:hover { background: #475569; }
.call-btn:active { transform: scale(0.97); }
.call-btn-primary { background: #2563eb; color: #fff; }
.call-btn-primary:hover { background: #1d4ed8; }
.call-btn-danger { background: #dc2626; color: #fff; }
.call-btn-danger:hover { background: #b91c1c; }
.call-btn-full { width: 100%; margin-top: 1rem; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #334155;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 1rem;
}
.icon-btn:hover { background: #475569; }

/* ── Meeting list ── */
.meeting-list { min-height: 60px; }
.meeting-list .muted { margin: 0.5rem 0; }

/* ── Call room ── */
.call-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0.5rem 1rem 0;
}
.call-header-room {
  padding-top: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #1e293b;
}
.call-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.room-layout {
  display: flex;
  flex: 1;
  gap: 1rem;
  padding: 0.75rem 0;
  min-height: 0;
}

/* ── Video grid ── */
.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  align-content: start;
  background: #0b1120;
  border-radius: 12px;
  padding: 0.75rem;
  min-height: 240px;
  transition: grid-template-columns 0.3s;
}
.video-grid.list-view {
  grid-template-columns: 1fr !important;
}
.video-grid.list-view .video-tile {
  aspect-ratio: 16 / 9;
}

/* ── Chat panel ── */
.chat-panel {
  width: 300px;
  flex-shrink: 0;
  background: #1e293b;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid #334155;
  overflow: hidden;
}
.chat-panel h3 {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background: #0f172a;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.chat-log {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  min-height: 100px;
}
.chat-form {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  background: #0f172a;
  border-top: 1px solid #334155;
}
.chat-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
}
.chat-form button {
  width: 40px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.chat-form button:hover { background: #1d4ed8; }

/* ── Call controls ── */
.call-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0 1rem;
  flex-wrap: wrap;
  border-top: 1px solid #1e293b;
  margin-top: 0.25rem;
}
.ctrl-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.9rem;
  border-radius: 12px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  min-width: 62px;
  border: 1px solid transparent;
}
.ctrl-btn i { font-size: 1.15rem; }
.ctrl-btn:hover {
  background: #334155;
  color: #f1f5f9;
}
.ctrl-btn:active { transform: scale(0.96); }
.ctrl-btn.active { background: #2563eb; color: #fff; }
.ctrl-btn.ctrl-danger { background: #7f1d1d; color: #fca5a5; }
.ctrl-btn.ctrl-danger:hover { background: #dc2626; color: #fff; }

.only-mobile { display: none; }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}
.modal-box {
  position: relative;
  background: #1e293b;
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid #334155;
  text-align: center;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.modal-box video {
  width: 100%;
  border-radius: 12px;
  background: #0f172a;
  aspect-ratio: 16 / 9;
  margin-bottom: 0.75rem;
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

/* ── Toast ── */
.call-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  border: 1px solid #334155;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 1100;
}
.call-toast.show { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .chat-panel {
    width: 100%;
    max-height: 280px;
  }
  .room-layout { flex-direction: column; }
  .only-mobile { display: inline-flex; }
}

@media (max-width: 480px) {
  .call-header h1, .call-header h2 { font-size: 1.1rem; }
  .lobby-card { padding: 1rem; }
  .ctrl-btn {
    min-width: 52px;
    font-size: 0.6rem;
    padding: 0.4rem 0.5rem;
  }
  .ctrl-btn i { font-size: 1rem; }
}