* { box-sizing: border-box; margin: 0; padding: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
body { background: linear-gradient(135deg, #020617, #111827 60%, #111827); color: #f8fafc; min-height: 100dvh; overflow: hidden; }

.view { display: none; min-height: 100dvh; width: 100vw; justify-content: center; align-items: center; padding: 20px; }
.view.active { display: flex; }

.auth-shell { display: flex; gap: 20px; align-items: stretch; width: min(1120px, 100%); }
.auth-box, .landing-container { background: rgba(30,41,59,0.96); padding: 32px; border-radius: 20px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.45); text-align: center; width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px; border: 1px solid rgba(99,102,241,0.25); backdrop-filter: blur(16px); }
.auth-box h1, .landing-container h2 { font-size: 27px; color: #fff; }
.auth-box p { color: #94a3b8; font-size: 14px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-badges span { background: rgba(99,102,241,0.16); color: #c7d2fe; border: 1px solid rgba(99,102,241,0.25); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; }
.info-panel { display: flex; flex-direction: column; gap: 14px; flex: 1; min-width: 280px; }
.panel-card { background: rgba(15,23,42,0.88); border: 1px solid rgba(148,163,184,0.18); border-radius: 18px; padding: 20px; text-align: left; box-shadow: 0 16px 40px rgba(2,6,23,0.28); }
.panel-card h3, .panel-card h4 { color: #fff; margin-bottom: 8px; }
.panel-card p { color: #cbd5e1; font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
.feature-list { list-style: none; display: grid; gap: 8px; color: #e2e8f0; font-size: 13px; margin: 10px 0 16px; }
.feature-list li::before { content: '✓'; color: #22c55e; margin-right: 8px; }
.pill-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-grid span { background: rgba(30,41,59,0.9); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.18); border-radius: 999px; padding: 6px 10px; font-size: 12px; }
.secondary-panel { background: linear-gradient(135deg, rgba(30,41,59,0.9), rgba(15,23,42,0.96)); }
.status-card { background: rgba(15,23,42,0.78); border: 1px solid rgba(99,102,241,0.25); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #cbd5e1; }
.status-card span:first-child { color: #fff; font-weight: 700; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.feature-item { background: rgba(15,23,42,0.72); border: 1px solid rgba(148,163,184,0.16); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.feature-item strong { color: #fff; font-size: 13px; }
.feature-item span { color: #cbd5e1; font-size: 12px; line-height: 1.4; }

.auth-tabs-switcher { display: flex; background: rgba(2,6,23,0.8); border-radius: 10px; padding: 4px; gap: 4px; }
.auth-tab-btn { flex: 1; padding: 8px; background: none; border: none; color: #94a3b8; font-weight: 600; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
.auth-tab-btn.active { background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff; }

.sub-form { display: none; flex-direction: column; gap: 12px; }
.sub-form.active { display: flex; }

input, select { width: 100%; padding: 12px 14px; background: rgba(2,6,23,0.85); border: 1px solid #334155; border-radius: 10px; color: #fff; font-size: 14px; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
input:focus, select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }

.primary-btn, .secondary-btn, .header-btn, .ctrl-btn, .tab-btn, .chat-input-row button, .wb-toolbar button { transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.primary-btn:hover, .secondary-btn:hover, .header-btn:hover, .ctrl-btn:hover, .chat-input-row button:hover, .wb-toolbar button:hover { transform: translateY(-1px); }

.primary-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; }
.secondary-btn { padding: 12px; background: #334155; color: #fff; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; width: 100%; text-align: center; }
.upgrade-link-btn { background: none; border: none; color: #f59e0b; font-weight: 700; cursor: pointer; font-size: 15px; margin-top: 10px; }
.join-row { display: flex; gap: 10px; }
.app-container { display: flex; flex-direction: column; height: 100dvh; width: 100vw; background: linear-gradient(180deg, rgba(2,6,23,0.9), rgba(15,23,42,0.95)); }
.app-header { min-height: 62px; background: rgba(15,23,42,0.94); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; border-bottom: 1px solid #334155; gap: 12px; flex-wrap: wrap; }
.room-info { display: flex; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.badge { background: linear-gradient(135deg, #4f46e5, #6366f1); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.header-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.header-btn { padding: 8px 14px; background: #334155; border: none; border-radius: 8px; color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; }
.header-btn.danger { background: #ef4444; }

.main-workspace { display: flex; flex: 1; overflow: hidden; position: relative; }
.video-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding: 20px; align-content: start; overflow-y: auto; transition: transform 0.5s ease; }
.video-box { background: linear-gradient(135deg, rgba(30,41,59,0.95), rgba(15,23,42,0.98)); border-radius: 14px; overflow: hidden; position: relative; aspect-ratio: 16/9; box-shadow: 0 8px 20px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; border: 1px solid rgba(148,163,184,0.16); }
video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); background: transparent; }
.video-label { position: absolute; bottom: 12px; left: 12px; background: rgba(15,23,42,0.8); padding: 4px 10px; border-radius: 999px; font-size: 12px; display: flex; align-items: center; gap: 6px; z-index: 10; }
.status-dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; }

.sidebar { width: min(360px, 100%); background: rgba(15,23,42,0.95); border-left: 1px solid #334155; display: flex; flex-direction: column; }
.tabs-header { display: flex; background: #020617; border-bottom: 1px solid #334155; }
.tab-btn { flex: 1; padding: 12px; background: none; border: none; color: #94a3b8; font-weight: 700; cursor: pointer; }
.tab-btn.active { color: #fff; border-bottom: 2px solid #6366f1; }
.tab-content { display: none; flex: 1; flex-direction: column; padding: 16px; overflow-y: auto; }
.tab-content.active { display: flex; }

.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.chat-msg { background: rgba(2,6,23,0.8); padding: 8px 12px; border-radius: 8px; font-size: 13px; word-break: break-word; border: 1px solid rgba(148,163,184,0.12); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row button { padding: 8px 14px; background: linear-gradient(135deg, #4f46e5, #6366f1); border: none; border-radius: 8px; color: #fff; cursor: pointer; }

.control-bar { min-height: 72px; background: rgba(15,23,42,0.96); display: flex; justify-content: center; align-items: center; gap: 16px; border-top: 1px solid #334155; padding: 10px 16px; }
.ctrl-btn { width: 50px; height: 50px; border-radius: 50%; border: none; background: #334155; color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ctrl-btn:hover { background: #475569; }
.ctrl-btn.active-off { background: #ef4444; }

.whiteboard-container { position: absolute; inset: 0; background: #020617; z-index: 50; display: none; flex-direction: column; }
.whiteboard-container.active { display: flex; }
.wb-toolbar { height: 54px; background: rgba(15,23,42,0.98); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; color: #fff; font-weight: 700; border-bottom: 1px solid #334155; gap: 10px; }
.wb-toolbar button { padding: 7px 12px; background: #334155; border: none; border-radius: 8px; color: #fff; cursor: pointer; }
canvas { flex: 1; cursor: crosshair; display: block; background: #020617; touch-action: none; }

.modal-overlay { position: fixed; inset: 0; background: rgba(2,6,23,0.85); z-index: 1000; display: none; justify-content: center; align-items: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-box { background: rgba(30,41,59,0.98); padding: 30px; border-radius: 16px; width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; gap: 16px; border: 1px solid #334155; }
.modal-box h2 { color: #fff; font-size: 22px; }
.modal-box p { color: #94a3b8; font-size: 14px; line-height: 1.5; }

#toast { position: fixed; bottom: 20px; left: 20px; background: rgba(15,23,42,0.96); color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.45); font-size: 14px; z-index: 99999; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; border: 1px solid rgba(99,102,241,0.25); max-width: min(420px, calc(100vw - 32px)); }
#toast.show { opacity: 1; }

@media (max-width: 900px) {
  .main-workspace { flex-direction: column; }
  .sidebar { width: 100%; border-left: none; border-top: 1px solid #334155; max-height: 42vh; }
  .app-header { padding: 12px 16px; }
  .video-grid { padding: 14px; }
  .auth-shell { flex-direction: column; }
  .info-panel { width: 100%; }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { overflow: auto; }
  .view { padding: 12px; }
  .auth-box, .landing-container { padding: 24px; }
  .join-row { flex-direction: column; }
  .header-controls { justify-content: flex-start; }
  .control-bar { gap: 10px; }
}
