﻿/* Trade Show Production UI - Shared layout and styling per TradeShow-UI-Spec-for-Cursor.md */
/* Higher specificity so these win over page-level <style> in demo pages. */

/* Page background - fill tablet screen */
.trade-show-page,
.ipad-screen .trade-show-page {
    min-height: 100%;
    height: 100%;
    width: 100%;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    padding: 0;
    box-sizing: border-box;
}

/* Layout container */
.demo-layout,
.trade-show-page .demo-layout {
    display: flex;
    min-height: 100%;
    height: 100%;
    width: 100%;
    position: relative;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    box-sizing: border-box;
}

/* HERO MODE - Avatar centered, full size (consistent large player at start, per spec) */
.demo-layout.hero {
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.demo-layout.hero .avatar-section,
.trade-show-page .demo-layout.hero .avatar-section {
    width: 100%;
    max-width: 600px;
    min-width: 280px; /* ensure video container gets width (was 0, caused offsetWidth=0) */
    min-height: 400px; /* consistent large player at start (same as FIService) */
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-layout.hero .avatar-section .video-wrap,
.demo-layout.hero .avatar-section .avatar-container,
.demo-layout.hero #videoContainer,
.trade-show-page .demo-layout.hero .video-wrap,
.trade-show-page .demo-layout.hero .avatar-container,
.trade-show-page .demo-layout.hero #videoContainer {
    min-height: 400px;
    flex: 1 1 auto;
}

.demo-layout.hero .menu-section {
    display: none !important;
}

/* SPLIT MODE - Side by side */
.demo-layout.split {
    flex-direction: row;
    padding-bottom: 28px; /* keep control bar and avatar buttons well above tablet frame */
    box-sizing: border-box;
}

.demo-layout.split .avatar-section,
.trade-show-page .demo-layout.split .avatar-section {
    width: 30%;
    min-width: 280px;
    max-width: 40%;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 220px; /* Stop/Pause/Reset fully above bottom bar */
    min-height: 0; /* allow section to shrink so controls stay visible */
    justify-content: flex-start; /* keep controls at bottom visible, don't center and clip */
}
/* In split mode, video area shrinks so Stop/Pause/Reset stay visible (e.g. Direct Marketing protection options) */
.demo-layout.split .avatar-section .video-wrap,
.trade-show-page .demo-layout.split .avatar-section .video-wrap {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
}
.demo-layout.split .avatar-section .avatar-controls,
.trade-show-page .demo-layout.split .avatar-section .avatar-controls {
    flex-shrink: 0;
    margin-top: auto; /* push controls to bottom of section so they stay visible */
}

.demo-layout.split .menu-section {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-width: 0;
}

/* FOCUS MODE - PiP avatar + full content */
.demo-layout.focus .avatar-section {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    border-radius: 12px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    overflow: hidden !important;
    padding: 0 !important;
    gap: 0 !important;
}

/* In focus/PiP mode: video fills the small box, controls hidden */
.demo-layout.focus .avatar-section .avatar-container {
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    flex: 1 !important;
    padding: 0 !important;
}

.demo-layout.focus .avatar-section .video-wrap {
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.demo-layout.focus .avatar-section .video-wrap video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

.demo-layout.focus .avatar-section .avatar-controls,
.demo-layout.focus .avatar-section .tablet-header,
.demo-layout.focus .avatar-section .voice-status {
    display: none !important;
}

.demo-layout.focus .menu-section {
    width: 100%;
    height: 100%;
    padding: 20px !important;
    padding-left: 220px !important;
    padding-top: 10px !important;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Avatar container - ensure section and video chain always have width (fixes offsetWidth=0) */
.trade-show-page .avatar-section {
    display: flex;
    flex-direction: column;
    background: #0f0f1a;
    position: relative;
    min-width: 280px;
}

.trade-show-page .avatar-container {
    min-width: 280px;
}

.trade-show-page .video-wrap,
.trade-show-page #videoContainer {
    min-width: 280px;
}

/* Inside tablet emulator: ensure avatar chain never gets 0 width (fixes Container dimensions: 0 x 360) */
.ipad-screen .trade-show-page .demo-layout {
    min-width: 280px;
}
.ipad-screen .trade-show-page .avatar-section,
.ipad-screen .trade-show-page .avatar-container,
.ipad-screen .trade-show-page .video-wrap,
.ipad-screen .trade-show-page #videoContainer {
    min-width: 280px;
}

/* Inside iPad frame: HERO = large player (consistent with FIService); SPLIT = video can shrink so controls stay visible */
.ipad-screen .trade-show-page .demo-layout.hero .avatar-section,
.ipad-screen .trade-show-page .demo-layout.hero .avatar-container {
    min-height: 0 !important;
    flex: 1 1 auto !important;
}
.ipad-screen .trade-show-page .demo-layout.hero .video-wrap,
.ipad-screen .trade-show-page .demo-layout.hero #videoContainer {
    min-height: 0 !important;
    flex: 1 1 0 !important;
    overflow: hidden;
}
.ipad-screen .trade-show-page .demo-layout.split .avatar-section,
.ipad-screen .trade-show-page .demo-layout.split .avatar-container {
    min-height: 0 !important;
}
.ipad-screen .trade-show-page .demo-layout.split .video-wrap {
    min-height: 0 !important;
    flex: 1 1 0 !important;
    overflow: hidden;
}
.ipad-screen .trade-show-page .video-wrap video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}
.ipad-screen .trade-show-page .avatar-controls {
    flex-shrink: 0 !important;
}

.trade-show-page .video-wrap {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-show-page .video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Override page-level white/light styles so avatar area matches dark spec */
.trade-show-page .avatar-container {
    background: #0f0f1a !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.trade-show-page .video-wrap {
    background: #000 !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Service Advisor (and similar) hero: header + controls in dark theme */
.trade-show-page .avatar-section .tablet-header {
    background: transparent !important;
    color: #e2e8f0;
}

.trade-show-page .avatar-section .tablet-header p {
    color: #94a3b8 !important;
}

.trade-show-page .avatar-controls {
    padding: 12px;
    background: transparent;
    flex-shrink: 0;
}

/* Stock/Custom toggle - dark theme */
.trade-show-page .avatar-type-toggle .btn-toggle,
.trade-show-page .avatar-type-toggle .btn-toggle-active {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    color: #94a3b8 !important;
}

.trade-show-page .avatar-type-toggle .btn-toggle-active {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: white !important;
}

.trade-show-page .btn-start {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none !important;
    color: white !important;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.trade-show-page .btn-start:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

/* In-screen control buttons (Stop, Pause, Reset) - visible inside tablet */
.trade-show-page .avatar-controls .control-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 10px 12px;
}

.trade-show-page .btn-stop,
.trade-show-page .btn-pause,
.trade-show-page .btn-reset {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.25);
    color: #e2e8f0;
    background: rgba(255,255,255,0.1);
}

.trade-show-page .btn-stop:hover,
.trade-show-page .btn-pause:hover,
.trade-show-page .btn-reset:hover {
    background: rgba(255,255,255,0.2);
}

.trade-show-page .btn-stop {
    background: rgba(239,68,68,0.3);
    border-color: #ef4444;
    color: #fca5a5;
}

.trade-show-page .btn-stop:hover {
    background: rgba(239,68,68,0.5);
}

.trade-show-page .btn-pause {
    background: rgba(245,158,11,0.3);
    border-color: #f59e0b;
    color: #fde68a;
}

.trade-show-page .btn-pause:hover {
    background: rgba(245,158,11,0.5);
}

/* Voice Status - ensure Ready is muted in production (not blue) */
.trade-show-page .avatar-section .voice-status.status-ready {
    background: rgba(255,255,255,0.2) !important;
    color: #94a3b8 !important;
}

/* Voice Status Indicator - inside avatar section */
.trade-show-page .avatar-section .voice-status,
.voice-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
}

.voice-status.status-speaking {
    background: #3b82f6;
    color: white;
}

.voice-status.status-listening {
    background: #10b981;
    color: white;
    animation: tradeshow-pulse 1.5s infinite;
}

.voice-status.status-ready {
    background: rgba(255,255,255,0.2);
    color: #94a3b8;
}

@keyframes tradeshow-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Menu Section */
.trade-show-page .menu-section {
    background: #1a1a2e;
    color: white;
    box-sizing: border-box;
}

/* Bottom Control Bar - inside demo layout */
.trade-show-page .demo-layout .demo-control-bar,
.demo-control-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    min-height: 36px;
    background: rgba(0,0,0,0.9);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    z-index: 50;
}

.demo-btn {
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.demo-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.demo-btn.active {
    color: white;
}

.demo-btn.fi.active { background: #10b981; }
.demo-btn.marketing.active { background: #ec4899; }
.demo-btn.service.active { background: #f59e0b; }
.demo-btn.afterhours.active { background: #6366f1; }
.demo-btn.pitch.active { background: #3b82f6; }
.demo-btn.mobile.active { background: #8b5cf6; }

.focus-toggle {
    margin-left: auto;
    padding: 8px 12px;
}

.focus-toggle.active {
    background: #ff6600;
    color: white;
}

.avatar-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
}

.badge-stock {
    background: #3b82f6;
    color: white;
}

.badge-custom {
    background: #8b5cf6;
    color: white;
}

/* FIService (and any page with accordion sidebar): full-page production theme */
.tablet-emulator-layout:has(.accordion-sidebar) {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 50%, #16213e 100%) !important;
}

/* When DevControls contain an accordion sidebar (e.g. FIService), use more width + fill row height */
.tablet-dev-controls-panel:has(.accordion-sidebar) {
    flex: 0 0 42%;
    min-width: 380px;
    max-width: 560px;
    align-self: stretch;
    max-height: 85vh;
    min-height: 400px;
    background: #0f0f1a !important;
    padding: 16px 20px !important;
    border: none !important;
    box-shadow: none !important;
    border-right: 1px solid rgba(255,255,255,0.06) !important;
}

/* Show controls bar matches production theme when FIService (accordion) is present */
.tablet-emulator-layout:has(.accordion-sidebar) .tablet-show-controls-bar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2) !important;
}

.tablet-emulator-layout:has(.accordion-sidebar) .tablet-show-controls-hint {
    color: #94a3b8 !important;
}

.tablet-emulator-layout:has(.accordion-sidebar) .tablet-show-controls-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    color: white !important;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4) !important;
}

.tablet-emulator-layout:has(.accordion-sidebar) .tablet-show-controls-btn:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5) !important;
}

.tablet-emulator-layout:has(.accordion-sidebar) .tablet-hide-controls-btn {
    background: rgba(255,255,255,0.08) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
}

.tablet-emulator-layout:has(.accordion-sidebar) .tablet-hide-controls-btn:hover {
    background: rgba(255,255,255,0.12) !important;
    color: #e2e8f0 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADDITIONS — Sprint M1
   Applied to all ~30 pages using this stylesheet.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Tablet (768–1199px) ─────────────────────────────────────────────────── */
@media (max-width: 1199px) {

  .trade-show-page { padding: 12px; }

  /* Main two-panel layout stacks vertically */
  .production-layout,
  .ts-layout,
  .main-content-area {
    flex-direction: column !important;
    gap: 16px;
  }

  /* Avatar side panel — full width on tablet */
  .avatar-side,
  .left-column,
  .avatar-col {
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto;
  }

  /* Right/content panel — full width */
  .content-side,
  .right-column,
  .content-col {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Control bar — allow wrapping */
  .control-bar,
  .action-bar,
  .btn-row {
    flex-wrap: wrap !important;
    gap: 8px;
  }

  /* Header shrinks */
  .page-header h1,
  .ts-header h1 {
    font-size: 1.4rem !important;
  }

  /* Status badges inline */
  .status-bar,
  .status-row {
    flex-wrap: wrap;
    gap: 6px;
  }

}

/* ─── Mobile landscape (481–767px) ────────────────────────────────────────── */
@media (max-width: 767px) {

  /* Split layout stacks vertically on mobile */
  .demo-layout.split {
    flex-direction: column !important;
  }

  .demo-layout.split .avatar-section,
  .trade-show-page .demo-layout.split .avatar-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-right: none !important;
    padding-bottom: 0 !important;
  }

  .demo-layout.split .menu-section {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-height: 0;
    overflow-y: auto;
  }

  .trade-show-page { padding: 8px; }

  /* Avatar video caps at 260px tall */
  .avatar-side video,
  .avatar-col video,
  #videoContainer video {
    max-height: 260px;
    border-radius: 8px;
  }

  /* Setup/config panels collapse */
  .setup-panel,
  .config-accordion {
    font-size: 13px;
  }

  /* Conversation display compact */
  .conversation-display,
  .response-area,
  .transcript-panel {
    max-height: 160px !important;
    font-size: 12px;
    overflow-y: auto;
  }

  /* Tier selection cards — 2 across */
  .tier-selection,
  .tier-cards-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  /* Score badges stack */
  .score-grid,
  .recommendation-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

}

/* ─── Mobile portrait (≤480px) ─────────────────────────────────────────────── */
@media (max-width: 480px) {

  .trade-show-page { padding: 6px; }

  /* Full-bleed header */
  .page-header,
  .ts-header {
    padding: 10px 12px !important;
    border-radius: 8px !important;
  }

  .page-header h1,
  .ts-header h1 {
    font-size: 1.1rem !important;
    margin-bottom: 4px !important;
  }

  /* Avatar video — portrait crop */
  .avatar-side video,
  .avatar-col video,
  #videoContainer video {
    max-height: 200px;
    width: 100%;
    border-radius: 8px;
  }

  /* Speaking indicator — compact */
  .speaking-indicator,
  .avatar-status-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Full-width text input + send row */
  .input-row,
  .chat-input-row {
    flex-direction: row !important;
    gap: 6px;
  }
  .input-row input,
  .chat-input-row input {
    flex: 1;
    min-width: 0;
  }

  /* Tier cards single column */
  .tier-selection,
  .tier-cards-row {
    grid-template-columns: 1fr !important;
  }

  /* Score badges single column */
  .score-grid,
  .recommendation-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hide decorative labels that waste space */
  .label-subtle,
  .helper-text {
    display: none;
  }

  /* Log panel minimal */
  .log-panel,
  .debug-log {
    max-height: 100px !important;
    font-size: 11px !important;
  }

  /* Setup accordions full width */
  .accordion-section {
    border-radius: 6px !important;
  }

}