/* Meet UI — Dark theme, glass-morphic panels, BOX brand (#fcb900) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif; background: #0f0f14; color: rgba(255,255,255,0.95); overflow: hidden; height: 100vh; }

/* Layout */
.meet-layout { display: flex; height: 100vh; position: relative; }

/* Header */
.meet-header { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: rgba(30,30,35,0.95); border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; z-index: 100; }
.meet-header-title { font-size: 15px; font-weight: 500; }
.meet-header-time { font-size: 13px; color: rgba(255,255,255,0.60); }

/* Chat Panel (left side) */
.chat-panel { width: 340px; height: calc(100vh - 56px); margin-top: 56px; background: rgba(15,15,20,0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-right: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; transition: margin-left 0.25s ease; flex-shrink: 0; z-index: 50; }
.chat-panel.hidden { margin-left: -340px; }

.chat-header { height: 44px; padding: 0 12px; background: rgba(252,185,0,0.85); border-top: 3px solid #fcb900; display: flex; align-items: center; gap: 12px; flex-shrink: 0; color: #1E1C1C; }
.chat-header-logo { font-weight: 700; font-size: 16px; background: rgba(255,255,255,0.15); padding: 4px 10px; border-radius: 6px; }
.chat-header-mode { font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.15); padding: 4px 8px; border-radius: 980px; }

/* Chat messages */
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 90%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; animation: fadeInUp 0.3s ease-out; white-space: pre-wrap; }
.chat-msg.ai { background: rgba(30,30,35,0.92); border: 1px solid rgba(255,255,255,0.06); align-self: flex-start; }
.chat-msg.user { background: rgba(252,185,0,0.15); border: 1px solid rgba(252,185,0,0.20); align-self: flex-end; }
.chat-msg.loading { animation: pulse 1.5s infinite; }

/* Preset buttons */
.chat-presets { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.preset-btn { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.90); border: 1px solid rgba(255,255,255,0.08); padding: 6px 12px; border-radius: 980px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s ease; font-family: inherit; white-space: nowrap; }
.preset-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.15); }

/* Chat input */
.chat-input-area { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.chat-input { flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; color: rgba(255,255,255,0.95); font-size: 13px; font-family: inherit; padding: 8px 12px; outline: none; resize: none; min-height: 36px; }
.chat-input:focus { border-color: rgba(252,185,0,0.50); }
.chat-send-btn { background: rgba(255,255,255,0.90); color: rgba(0,0,0,0.70); border: none; border-radius: 8px; padding: 8px 14px; font-size: 16px; cursor: pointer; min-height: 36px; font-family: inherit; transition: all 0.15s ease; }
.chat-send-btn:hover { background: rgba(255,255,255,1); }

/* Main video area */
.main-area { flex: 1; margin-top: 56px; display: flex; flex-direction: column; position: relative; background: #0f0f14; }
.video-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at center, rgba(30,30,40,0.8), #0f0f14); }
.video-avatar { width: 120px; height: 120px; border-radius: 50%; background: rgba(252,185,0,0.15); display: flex; align-items: center; justify-content: center; font-size: 48px; color: #fcb900; border: 2px solid rgba(252,185,0,0.30); }

/* Caption overlay */
.caption-overlay { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: min(60%, 560px); background: rgba(15,15,20,0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 0; z-index: 40; }
.caption-text { padding: 12px 16px; font-size: 16px; font-weight: 500; line-height: 1.4; min-height: 48px; }
.caption-speaker { color: #fcb900; font-weight: 600; }
.caption-buttons { padding: 8px 16px 12px; display: flex; gap: 8px; border-top: 1px solid rgba(255,255,255,0.06); }
.caption-btn { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.90); border: 1px solid rgba(255,255,255,0.08); padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s ease; font-family: inherit; }
.caption-btn:hover { background: rgba(255,255,255,0.12); }
.caption-btn.primary { background: rgba(252,185,0,0.15); border-color: rgba(252,185,0,0.30); color: #fcb900; }
.caption-btn.primary:hover { background: rgba(252,185,0,0.25); }

/* Job recommendation cards */
.job-card { border-radius: 12px; padding: 16px; margin-bottom: 4px; animation: fadeInUp 0.4s ease-out; }
.job-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.job-card-tier { font-size: 14px; font-weight: 600; }
.job-card-rate { padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.job-card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.job-card-detail { font-size: 13px; color: rgba(255,255,255,0.60); margin-bottom: 8px; }
.job-card-script { background: rgba(255,255,255,0.04); padding: 10px; border-radius: 8px; font-size: 12px; color: rgba(255,255,255,0.60); line-height: 1.5; }

/* Post-meeting overlay */
.post-meeting-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.70); display: flex; align-items: center; justify-content: center; z-index: 200; animation: fadeIn 0.3s ease; }
.post-meeting-loading { text-align: center; color: rgba(255,255,255,0.90); font-size: 18px; font-weight: 500; }
.post-meeting-loading .spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.20); border-top-color: #fcb900; border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 10px; vertical-align: middle; }

/* Post-meeting summary panel (replaces video area) */
.post-meeting-summary { padding: 24px; overflow-y: auto; height: 100%; animation: fadeInUp 0.4s ease-out; }
.post-meeting-summary h2 { font-size: 18px; font-weight: 600; margin-bottom: 20px; color: rgba(255,255,255,0.95); }
.pm-step { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; color: rgba(255,255,255,0.70); }
.pm-step .pm-icon { font-size: 16px; width: 24px; text-align: center; }
.pm-step .pm-status { margin-left: auto; font-size: 13px; color: rgba(255,255,255,0.30); }
.pm-step .pm-status.done { color: #4caf50; }
.pm-step .pm-status .spinner-sm { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.15); border-top-color: #fcb900; border-radius: 50%; animation: spin 0.8s linear infinite; }
.pm-divider { border: none; border-top: 1px solid rgba(255,255,255,0.10); margin: 20px 0; }
.pm-section-title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.50); margin-bottom: 12px; }
.pm-crm-table { font-size: 13px; line-height: 1.7; color: rgba(255,255,255,0.80); }
.pm-crm-table .pm-crm-label { color: rgba(255,255,255,0.45); margin-right: 8px; }
.pm-letter-preview { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 16px; font-size: 13px; line-height: 1.7; color: rgba(255,255,255,0.70); white-space: pre-wrap; margin-top: 8px; }
.pm-slack-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(76,175,80,0.12); border: 1px solid rgba(76,175,80,0.25); color: #4caf50; padding: 6px 14px; border-radius: 980px; font-size: 13px; font-weight: 500; margin-top: 16px; animation: fadeInUp 0.4s ease-out; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Scrollbar */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ========== Mobile (portrait phone) ========== */
@media (max-width: 768px) {
  body { overflow: hidden; height: 100vh; }

  /* Header: compact */
  .meet-header { height: 44px; padding: 0 12px; }
  .meet-header-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
  #toggle-chat, #btn-end-meeting { min-height: 36px; padding: 6px 10px !important; font-size: 11px !important; }

  /* Layout: fixed vertical within 100vh */
  .meet-layout {
    flex-direction: column; height: calc(100vh - 44px); margin-top: 44px;
    overflow: hidden;
  }

  /* Video area: top 35% */
  .main-area { flex: none; height: 35vh; margin-top: 0; position: relative; min-height: 0; }
  .video-placeholder { height: 100%; }
  .video-avatar { width: 64px; height: 64px; font-size: 28px; }

  /* Caption: bottom of video, full width */
  .caption-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    transform: none; width: 100%; border-radius: 0;
    background: rgba(0,0,0,0.75);
  }
  .caption-text { font-size: 13px; padding: 8px 12px; min-height: 36px; }
  .caption-buttons { padding: 4px 8px 8px; gap: 4px; flex-wrap: wrap; }
  .caption-btn { padding: 6px 10px; font-size: 11px; min-height: 36px; }

  /* Chat: fills remaining space below video */
  .chat-panel {
    width: 100%; flex: 1; margin-top: 0; height: auto;
    border-right: none; border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; flex-direction: column; overflow: hidden;
  }
  .chat-panel.hidden { display: flex; } /* always show on mobile */
  .chat-header { height: 36px; padding: 0 10px; }
  .chat-header-logo { font-size: 14px; padding: 2px 8px; }
  .chat-header-mode { font-size: 10px; }

  /* Chat messages: scrollable */
  .chat-messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px; gap: 6px; min-height: 0; max-height: none; }
  .chat-msg { font-size: 12px; max-width: 95%; padding: 8px 10px; }

  /* Presets: 2x2 compact */
  .chat-presets { padding: 6px 8px; gap: 4px; display: grid; grid-template-columns: 1fr 1fr; }
  .preset-btn { padding: 8px 6px; font-size: 11px; min-height: 36px; text-align: center; white-space: normal; }

  /* Input: bottom */
  .chat-input-area { padding: 6px 8px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .chat-input { font-size: 16px; min-height: 40px; padding: 8px 10px; }
  .chat-send-btn { min-height: 40px; min-width: 40px; padding: 6px; }

  /* Post-meeting */
  .post-meeting-summary { padding: 12px; }
  .post-meeting-summary h2 { font-size: 15px; }

  /* Job cards */
  .job-card { padding: 10px; }
  .job-card-title { font-size: 13px; }
  .job-card-script { font-size: 11px; padding: 6px; }
}
