/* MeetPro - Main Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

:root {
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── LOBBY ─────────────────────────────────── */
.lobby-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--gray-100);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--gray-900);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.lobby-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.lobby-container {
  width: 100%;
  max-width: 520px;
}

.lobby-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.lobby-subtitle {
  color: var(--gray-500);
  font-size: 1rem;
  margin-bottom: 40px;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-input::placeholder { color: var(--gray-400); }

.form-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 24px 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
  height: 48px;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(37,99,235,0.4);
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}

.btn-ghost:hover { background: var(--gray-50); border-color: var(--gray-300); }

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover { background: #b91c1c; }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover { background: #15803d; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
  font-size: 1rem;
  transition: all var(--transition);
}

.btn-icon:hover { background: rgba(255,255,255,0.2); }
.btn-icon.active { background: var(--danger); }
.btn-icon.muted { background: rgba(220,38,38,0.8); }

/* ─── SALA ────────────────────────────────── */
.sala-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--gray-900);
  overflow: hidden;
}

.sala-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(17,24,39,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  z-index: 10;
}

.sala-info {
  display: flex;
  flex-direction: column;
}

.sala-tema {
  font-size: 0.9375rem;
  font-weight: 500;
  color: white;
}

.sala-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.sala-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse 2s infinite;
}

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

.sala-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ─── VIDEOS ─────────────────────────────── */
.videos-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.videos-grid {
  flex: 1;
  display: grid;
  gap: 4px;
  padding: 4px;
  overflow: hidden;
}

.videos-grid.layout-1  { grid-template-columns: 1fr; }
.videos-grid.layout-2  { grid-template-columns: 1fr 1fr; }
.videos-grid.layout-3  { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.videos-grid.layout-3 .video-tile:first-child { grid-column: 1 / -1; }
.videos-grid.layout-4  { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.videos-grid.layout-6  { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
.videos-grid.layout-9  { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.videos-grid.layout-12 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
.videos-grid.layout-16 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); }

.video-tile {
  position: relative;
  background: var(--gray-800);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.video-tile-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-tile-name {
  font-size: 0.8125rem;
  color: white;
  font-weight: 500;
}

.video-tile-icons {
  display: flex;
  gap: 4px;
}

.tile-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: rgba(0,0,0,0.4);
  color: white;
}

.tile-icon.off { background: rgba(220,38,38,0.7); }

.avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.video-off-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--gray-800);
}

/* ─── CONTROLES ───────────────────────────── */
.sala-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(17,24,39,0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border: none;
  background: rgba(255,255,255,0.07);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  min-width: 64px;
}

.ctrl-btn:hover { background: rgba(255,255,255,0.12); }
.ctrl-btn.active { background: var(--danger); }
.ctrl-btn.recording { background: var(--danger); animation: pulse 1s infinite; }
.ctrl-btn.ctrl-leave { background: var(--danger); }
.ctrl-btn.ctrl-leave:hover { background: #b91c1c; }

.ctrl-btn .ctrl-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* ─── CHAT SIDEBAR ───────────────────────── */
.chat-sidebar {
  width: 320px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--gray-200);
  flex-shrink: 0;
  transition: width var(--transition);
}

.chat-sidebar.hidden { width: 0; overflow: hidden; }

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
}

.chat-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.chat-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.chat-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.chat-panel { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.chat-panel.active { display: flex; }

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

.messages-list::-webkit-scrollbar { width: 4px; }
.messages-list::-webkit-scrollbar-track { background: transparent; }
.messages-list::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }

.message-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.message-sender {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
}

.message-time {
  font-size: 0.6875rem;
  color: var(--gray-400);
}

.message-bubble {
  background: var(--gray-100);
  border-radius: 0 10px 10px 10px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--gray-800);
  max-width: 100%;
  word-break: break-word;
  line-height: 1.5;
}

.message-bubble.mine {
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 10px 0 10px 10px;
  align-self: flex-end;
}

.message-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.8125rem;
}

.message-file:hover { background: var(--gray-200); }
.message-file-icon { font-size: 1.25rem; }

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.emoji-picker {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  max-height: 100px;
  overflow-y: auto;
}

.emoji-picker.show { display: flex; }

.emoji-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.125rem;
  border-radius: 6px;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-btn:hover { background: var(--gray-200); }

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-800);
  outline: none;
  transition: border-color var(--transition);
  max-height: 80px;
  min-height: 40px;
  line-height: 1.4;
}

.chat-textarea:focus { border-color: var(--accent); }

.chat-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send-btn:hover { background: var(--accent-hover); }

.chat-actions-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.chat-action-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--gray-200);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.chat-action-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── PARTICIPANTES ────────────────────── */
.participants-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
}

.participant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  flex-shrink: 0;
}

.participant-info { flex: 1; min-width: 0; }

.participant-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-role {
  font-size: 0.6875rem;
  color: var(--gray-400);
}

.badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.badge-host { background: var(--accent-light); color: var(--accent); }
.badge-waiting { background: var(--warning-light); color: var(--warning); }
.badge-approved { background: var(--success-light); color: var(--success); }
.badge-refused { background: var(--danger-light); color: var(--danger); }

/* ─── MODAL ───────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 32px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ─── NOTIFICATION ────────────────────── */
.notifications-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.notification {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
  animation: slideInRight 0.3s ease;
}

.notification.danger { border-left-color: var(--danger); }
.notification.success { border-left-color: var(--success); }
.notification.warning { border-left-color: var(--warning); }

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

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.notif-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); }

.notif-body { font-size: 0.8125rem; color: var(--gray-600); margin-bottom: 12px; }

.notif-actions { display: flex; gap: 8px; }

.notif-btn {
  flex: 1;
  height: 32px;
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.notif-btn.accept { background: var(--success); color: white; }
.notif-btn.accept:hover { background: #15803d; }
.notif-btn.refuse { background: var(--gray-100); color: var(--gray-600); }
.notif-btn.refuse:hover { background: var(--gray-200); }

/* ─── LOADING ─────────────────────────── */
.loading-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--white);
  gap: 24px;
}

.loading-logo { font-size: 1.5rem; font-weight: 600; color: var(--gray-900); }

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text { font-size: 0.9375rem; color: var(--gray-500); }

/* ─── LINK BOX ────────────────────────── */
.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.link-text {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--gray-600);
  font-family: 'DM Mono', monospace;
  word-break: break-all;
}

.link-copy-btn {
  height: 32px;
  padding: 0 12px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}

.link-copy-btn:hover { background: var(--accent-hover); }

/* ─── RECORDING INDICATOR ─────────────── */
.rec-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(220,38,38,0.15);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 600;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1s infinite;
}

/* ─── SHARE SCREEN ────────────────────── */
.screen-share-active {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(37,99,235,0.9);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
  z-index: 5;
}

/* ─── RESPONSIVE ──────────────────────── */
@media (max-width: 768px) {
  .lobby-header { padding: 16px 20px; }
  .lobby-title { font-size: 1.5rem; }
  .form-card { padding: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .chat-sidebar { position: fixed; right: 0; top: 0; bottom: 0; z-index: 100; box-shadow: var(--shadow-xl); }
  .sala-controls { gap: 6px; padding: 10px 12px; }
  .ctrl-btn { padding: 8px 10px; min-width: 52px; font-size: 0.625rem; }
}

/* ─── UTILS ───────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--gray-500); }
.w-full { width: 100%; }
