/**
 * PRESENTATION STYLES
 *
 * Clean, modern dark theme for PDF presentation
 * Full-screen display with centered canvas and fixed navigation controls
 */

/* Email Gate Styles - Matching 3degs visual design */
.email-gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-in;
}

.email-gate-overlay.fade-out {
  animation: fadeOut 0.3s ease-out;
  opacity: 0;
}

.email-gate-modal {
  position: relative;
  overflow: visible;
  background: rgba(20, 29, 45, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease-out;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.email-gate-modal.video-mode {
  max-width: 90vw;
  max-height: 90vh;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* Circular video thumbnail */
.video-thumbnail-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 10;
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-thumbnail-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 169, 37, 0.6);
  box-shadow: 0 8px 32px rgba(255, 169, 37, 0.3);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-thumbnail-circle video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.video-thumbnail-circle .thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Expanding states */
.video-thumbnail-container.expanding {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 10001;
}

.video-thumbnail-circle.expanding {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border-color: rgba(255, 169, 37, 0.3);
}

/* Skip video button */
.skip-video-btn {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10002;
}

.skip-video-btn.visible {
  opacity: 1;
  visibility: visible;
}

.skip-video-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

/* Logo thumbnail (basic version - no video) */
.logo-thumbnail-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.logo-thumbnail-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 169, 37, 0.6);
  box-shadow: 0 8px 32px rgba(255, 169, 37, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.logo-thumbnail-circle .gate-logo {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

/* Form content area */
.email-gate-content {
  position: relative;
  z-index: 1;
  padding: 2rem 2.5rem 2.5rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.email-gate-content.form-hidden .email-gate-header,
.email-gate-content.form-hidden .email-gate-form {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.email-gate-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.email-gate-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #ffffff;
}

.email-gate-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 500;
}

.email-gate-form {
  /* No margin needed */
}

.email-gate-input-group {
  margin-bottom: 1rem;
}

.email-gate-input-group label {
  display: block;
  margin-bottom: 0.35rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 500;
}

.email-gate-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  transition: all 0.2s ease;
}

.email-gate-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffa925;
}

.email-gate-input.error {
  border-color: #e14716;
  background: rgba(225, 71, 22, 0.1);
}

.email-gate-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.email-gate-submit {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: #ffa925;
  border: none;
  border-radius: 8px;
  color: #141d2d;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.email-gate-submit:hover {
  background: #e89820;
  transform: translateY(-1px);
}

.email-gate-submit:active {
  transform: translateY(0);
}

.email-gate-error {
  display: none;
  background: rgba(255, 59, 48, 0.2);
  border: 1px solid rgba(255, 59, 48, 0.4);
  color: #ff6b6b;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.email-gate-error.show {
  display: block;
  animation: shake 0.3s ease;
}

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

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* User Gate Extended Form */
.user-gate-modal {
  max-width: 600px;
}

.user-gate-row {
  display: flex;
  gap: 1rem;
}

.user-gate-row .email-gate-input-group {
  flex: 1;
}

@media (max-width: 500px) {
  .user-gate-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Text-only mode indicator */
.text-mode-indicator {
  position: fixed;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.6rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.text-mode-indicator svg {
  width: 10px;
  height: 10px;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Sora', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background-color: #141d2d;
  color: #ffffff;
  overflow: hidden;
  width: 100%;
  height: 100vh;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Prevent browser zoom on touch devices */
  touch-action: pan-x pan-y;
  -ms-touch-action: pan-x pan-y;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

/* Main container layout */
#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* PDF canvas container - takes most of the space */
#pdf-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  overflow: auto;
  background: linear-gradient(135deg, #141d2d 0%, #1a2538 100%);
}

#pdf-canvas {
  width: auto;
  height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  flex-shrink: 0;
}

/* Zoom Controls */
.zoom-controls {
  position: fixed;
  bottom: 0.5rem;
  left: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(20, 29, 45, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(180, 204, 197, 0.2);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  z-index: 100;
}

.zoom-btn {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(180, 204, 197, 0.3);
  background: rgba(180, 204, 197, 0.1);
  border-radius: 3px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.zoom-btn:hover:not(:disabled) {
  background: rgba(255, 169, 37, 0.3);
  border-color: #ffa925;
}

.zoom-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.zoom-level {
  min-width: 32px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.65rem;
}

.zoom-btn-reset {
  font-size: 0.6rem;
  padding: 0 0.3rem;
  width: auto;
  height: 22px;
}

/* PDF Link Layer */
#pdf-link-layer {
  pointer-events: none;
}

#pdf-link-layer .pdf-link {
  pointer-events: auto;
  background: transparent;
  transition: background-color 0.2s ease;
}

#pdf-link-layer .pdf-link:hover {
  background-color: rgba(76, 175, 80, 0.2);
  outline: 2px solid rgba(76, 175, 80, 0.5);
  outline-offset: -2px;
}

/* Controls container - fixed at bottom */
#controls-container {
  position: relative;
  padding: 0.15rem 0.5rem;
  padding-bottom: max(0.15rem, env(safe-area-inset-bottom, 0));
  background: rgba(20, 29, 45, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(180, 204, 197, 0.15);
}

.nav-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Download link */
.download-link {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: rgba(180, 204, 197, 0.1);
  border: 1px solid rgba(180, 204, 197, 0.25);
  border-radius: 3px;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.download-link:hover {
  background: rgba(255, 169, 37, 0.25);
  border-color: #ffa925;
  transform: translateY(-1px);
}

.download-link svg {
  flex-shrink: 0;
}

/* Inline Zoom Controls */
.zoom-controls-inline {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.5rem;
}

.zoom-level-inline {
  min-width: 36px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.6rem;
}

.page-counter-text {
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nav-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Navigation buttons */
.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  background: rgba(180, 204, 197, 0.1);
  border: 1px solid rgba(180, 204, 197, 0.25);
  border-radius: 3px;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  min-width: 60px;
}

.nav-button:hover:not(:disabled) {
  background: rgba(255, 169, 37, 0.25);
  border-color: #ffa925;
  transform: translateY(-2px);
}

.nav-button:active:not(:disabled) {
  transform: translateY(0);
}

.nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-button .arrow {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Old page counter styles (kept for backwards compatibility) */
.page-counter {
  /* Styles moved to .page-counter-text */
}

/* Voice Controls Inline Button */
.voice-button-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.5rem;
  background: rgba(180, 204, 197, 0.1);
  border: 1px solid rgba(180, 204, 197, 0.25);
  border-radius: 3px;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: default;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  opacity: 0.5;
  min-height: 26px;
  min-width: auto;
  justify-content: center;
}

.sp-avatar-container {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(180, 204, 197, 0.4);
  flex-shrink: 0;
  background: linear-gradient(135deg, #141d2d 0%, #1a2538 100%);
  transition: all 0.3s ease;
}

.sp-avatar {
  width: 100%;
  height: 100%;
  background-image: url('../sp-avatar.png');
  background-size: cover;
  background-position: center;
}

.voice-status-inline {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

/* Ready state */
.voice-button-inline.ready {
  border-color: rgba(255, 169, 37, 0.5);
  cursor: pointer;
  opacity: 1;
}

.voice-button-inline.ready .sp-avatar-container {
  border-color: rgba(255, 169, 37, 0.5);
}

.voice-button-inline.ready:hover {
  background: rgba(255, 169, 37, 0.2);
  border-color: #ffa925;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 169, 37, 0.25);
}

.voice-button-inline.ready:hover .sp-avatar-container {
  border-color: #ffa925;
}

/* Active state (listening) */
.voice-button-inline.active {
  background: rgba(255, 169, 37, 0.25);
  border-color: #ffa925;
  animation: pulse-inline 2s infinite;
  cursor: pointer;
  opacity: 1;
}

.voice-button-inline.active .sp-avatar-container {
  border-color: #ffa925;
  box-shadow: 0 0 15px rgba(255, 169, 37, 0.5);
}

.voice-button-inline.active:hover {
  background: rgba(225, 71, 22, 0.25);
  border-color: #e14716;
  animation: none;
  transform: translateY(-2px);
}

.voice-button-inline.active:hover .sp-avatar-container {
  border-color: #e14716;
  box-shadow: 0 0 15px rgba(225, 71, 22, 0.5);
}

/* Speaking state */
.voice-button-inline.speaking {
  background: rgba(33, 150, 243, 0.2);
  border-color: rgba(33, 150, 243, 0.8);
  animation: glow-inline 1.5s ease-in-out infinite;
}

.voice-button-inline.speaking .sp-avatar-container {
  border-color: rgba(33, 150, 243, 0.8);
  box-shadow: 0 0 20px rgba(33, 150, 243, 0.6);
}

/* Muted state */
.voice-button-inline.muted {
  background: rgba(158, 158, 158, 0.2);
  border-color: rgba(158, 158, 158, 0.6);
  animation: none;
}

.voice-button-inline.muted .sp-avatar-container {
  border-color: rgba(158, 158, 158, 0.6);
  box-shadow: 0 0 10px rgba(158, 158, 158, 0.3);
  opacity: 0.7;
}

.voice-button-inline.muted:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.8);
}

/* Animations */
@keyframes pulse-inline {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(76, 175, 80, 0);
  }
}

@keyframes glow-inline {
  0%, 100% {
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.5);
  }
  50% {
    box-shadow: 0 0 25px rgba(33, 150, 243, 0.8);
  }
}

/* ========================================
   MOBILE LAYOUT (768px and below)
   ======================================== */
@media (max-width: 768px) {
  /* PDF container - no browser pinch zoom (page is locked, use internal zoom) */
  #pdf-container {
    padding: 0.5rem;
    padding-top: 3rem; /* Space for page counter and download */
    padding-bottom: 5rem; /* Space for fixed nav */
    touch-action: pan-x pan-y; /* Allow scroll but NOT browser zoom */
  }

  /* Page counter - hide the one in nav-wrapper on mobile (JS moves to body) */
  .nav-wrapper .page-counter-text {
    display: none;
  }

  /* Download button - hide the one in nav-wrapper on mobile (JS moves to body) */
  .nav-wrapper .download-link {
    display: none;
  }
}

/* Mobile fixed elements (moved to body by JS) */
.page-counter-text.mobile-fixed {
  position: fixed !important;
  top: 0.5rem !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  font-size: 0.75rem !important;
  background: rgba(20, 29, 45, 0.95) !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 1rem !important;
  z-index: 200 !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  display: block !important;
}

.download-link.mobile-fixed {
  position: fixed !important;
  top: 0.35rem !important;
  right: 0.5rem !important;
  left: auto !important;
  bottom: auto !important;
  padding: 0.5rem !important;
  min-width: 44px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 200 !important;
  background: rgba(20, 29, 45, 0.95) !important;
  border-radius: 50% !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Hide download text when mobile-fixed */
.download-link.mobile-fixed span {
  display: none !important;
}

@media (max-width: 768px) {
  /* Hide download text on mobile (when still in nav-wrapper) */
  .download-link span {
    display: none !important;
  }

  /* Fixed controls at bottom */
  #controls-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0));
    z-index: 100;
  }

  /* Simple horizontal layout for mobile nav */
  .nav-wrapper {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
  }

  /* Hide zoom controls on mobile */
  .zoom-controls-inline {
    display: none;
  }

  /* Nav controls - centered row */
  .nav-controls {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  /* Nav buttons - icons only */
  .nav-button {
    padding: 0.75rem;
    min-width: 48px;
    min-height: 48px;
    font-size: 0;  /* Hide text */
  }

  /* Show only arrows */
  .nav-button .arrow {
    font-size: 1.25rem;
  }

  /* Voice button compact - hidden in text mode but keep styles */
  .voice-button-inline {
    padding: 0.5rem 0.75rem;
    min-height: 48px;
    gap: 0.25rem;
  }

  .sp-avatar-container {
    width: 24px;
    height: 24px;
  }

  .voice-status-inline {
    font-size: 0.65rem;
  }

  /* Chat toggle - position above nav bar */
  .chat-toggle-btn {
    bottom: 5rem !important;
    right: 0.75rem !important;
    width: 48px !important;
    height: 48px !important;
  }

  /* Loading screen mobile */
  #loading-screen h1 {
    font-size: 1.5rem;
  }

  .loading-progress {
    max-width: 85%;
    width: 250px;
  }

  /* Email gate mobile */
  .email-gate-content {
    padding: 1.5rem 1rem;
  }

  .email-gate-header h2 {
    font-size: 1.25rem;
  }

  .email-gate-subtitle {
    font-size: 0.8rem;
  }

  /* AI disclaimer mobile */
  .ai-disclaimer-content {
    padding: 1rem;
    margin: 0.5rem;
  }

  .ai-disclaimer-content h3 {
    font-size: 1rem;
  }

  .ai-disclaimer-content p {
    font-size: 0.85rem;
  }
}

/* Extra small phones (375px and below) */
@media (max-width: 375px) {
  .nav-controls {
    gap: 0.25rem;
  }

  .nav-button {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
  }

  .voice-button-inline {
    padding: 0.25rem 0.5rem;
  }

  .chat-input {
    font-size: 14px;
  }
}

/* ========================================
   CHAT INTERFACE
   ======================================== */

/* Chat Panel */
.chat-panel {
  position: fixed;
  top: 0;
  right: -300px; /* Hidden by default */
  width: 300px;
  height: 100vh;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(76, 175, 80, 0.2);
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1100;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.chat-panel.visible {
  right: 0;
}

/* Chat Header */
.chat-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(76, 175, 80, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header h3 {
  margin: 0;
  color: #ffffff;
  font-family: 'Sora', 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
}

.chat-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-close:hover {
  color: rgba(76, 175, 80, 1);
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(76, 175, 80, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(76, 175, 80, 0.5);
}

/* Message Bubbles */
.message {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 85%;
  animation: messageSlideIn 0.3s ease;
}

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

.message.user {
  align-self: flex-end;
}

.message.agent {
  align-self: flex-start;
}

.message.system {
  align-self: center;
  max-width: 90%;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  word-wrap: break-word;
  line-height: 1.4;
  font-family: 'Sora', 'DM Sans', sans-serif;
  font-size: 0.75rem;
}

.message.user .message-content {
  background: rgba(76, 175, 80, 0.3);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #ffffff;
  border-bottom-right-radius: 0.25rem;
}

.message.agent .message-content {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.95);
  border-bottom-left-radius: 0.25rem;
}

.message.system .message-content {
  background: rgba(255, 183, 77, 0.15);
  border: 1px solid rgba(255, 183, 77, 0.3);
  color: rgba(255, 183, 77, 0.95);
  font-size: 0.875rem;
  text-align: center;
}

/* Chat message links */
.message-content a {
  color: #4fc3f7;
  text-decoration: underline;
  word-break: break-all;
}

.message-content a:hover {
  color: #81d4fa;
  text-decoration: underline;
}

.message.user .message-content a {
  color: #a5d6a7;
}

.message.user .message-content a:hover {
  color: #c8e6c9;
}

.message-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 0 0.5rem;
}

.message.user .message-time {
  text-align: right;
}

.message.agent .message-time {
  text-align: left;
}

.message.system .message-time {
  text-align: center;
}

/* Typing Indicator */
.typing-indicator {
  align-self: flex-start;
  max-width: 85%;
}

.typing-indicator .message-content {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  align-items: center;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.7);
  animation: typingPulse 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingPulse {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Chat Input Form */
.chat-form {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(76, 175, 80, 0.2);
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  background: rgba(10, 10, 10, 0.5);
}

.chat-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(180, 204, 197, 0.3);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #ffffff;
  font-family: 'Sora', 'DM Sans', sans-serif;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input:focus {
  outline: none;
  border-color: rgba(255, 169, 37, 0.6);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 169, 37, 0.1);
}

.chat-send {
  background: rgba(255, 169, 37, 0.3);
  border: 1px solid rgba(255, 169, 37, 0.4);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Sora', 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-send:hover {
  background: rgba(255, 169, 37, 0.5);
  border-color: #ffa925;
  transform: translateY(-1px);
}

.chat-send:active {
  transform: translateY(0);
}

/* Chat Toggle Button */
.chat-toggle-btn {
  position: fixed;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.3);
  border: 2px solid rgba(76, 175, 80, 0.4);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
  padding: 0;
}

.chat-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.chat-toggle-btn:hover {
  background: rgba(76, 175, 80, 0.5);
  border-color: rgba(76, 175, 80, 0.6);
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(76, 175, 80, 0.4);
}

.chat-toggle-btn:active {
  transform: scale(1.05);
}

.chat-toggle-btn.active {
  background: rgba(76, 175, 80, 0.5);
  border-color: rgba(76, 175, 80, 0.7);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-panel {
    width: 100%;
    right: -100%;
  }

  .chat-panel.visible {
    right: 0;
  }

  .chat-toggle-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .message {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .chat-header {
    padding: 1rem;
  }

  .chat-messages {
    padding: 1rem;
  }

  .chat-form {
    padding: 0.75rem 1rem;
  }

  .chat-send {
    padding: 0.75rem 1rem;
  }

  .chat-toggle-btn {
    bottom: 1rem;
    right: 1rem;
    width: 52px;
    height: 52px;
  }
}

/* Loading state */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Error state */
.error {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
}

.error h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #ff6b6b;
}

.error p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

/* Smooth transitions */
#pdf-canvas {
  transition: opacity 0.2s ease;
}

/* Focus styles for accessibility */
.nav-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  #controls-container,
  elevenlabs-convai,
  .hamburger-button,
  .slide-sidebar {
    display: none;
  }

  #pdf-container {
    padding: 0;
  }

  body {
    background: white;
  }
}

/* ========================================
   SLIDE SIDEBAR
   ======================================== */

/* Hamburger Button */
.hamburger-button {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1001;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.hamburger-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.hamburger-button:active {
  transform: translateY(0);
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hamburger-icon span {
  display: block;
  width: 16px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Sidebar Overlay - transparent, pointer-events disabled to not block clicks */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Slide Sidebar */
.slide-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  max-width: 85vw;
  height: 100vh;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.slide-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 1rem 0.75rem 0.5rem 3.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-header h3 {
  font-family: 'Sora', 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Slide List */
.slide-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.slide-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.slide-link {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Sora', 'DM Sans', sans-serif;
  font-size: 0.75rem;
  line-height: 1.3;
}

.slide-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.slide-number {
  flex-shrink: 0;
  display: inline-block;
  min-width: 1.5rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
}

.slide-title {
  flex: 1;
}

/* Active slide highlight */
.slide-item.active .slide-link {
  background: rgba(76, 175, 80, 0.15);
  color: #ffffff;
  border-left: 3px solid rgba(76, 175, 80, 0.8);
  padding-left: calc(0.75rem - 3px);
}

.slide-item.active .slide-number {
  color: rgba(76, 175, 80, 1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hamburger-button {
    top: 0.75rem;
    left: 0.75rem;
    width: 36px;
    height: 36px;
  }

  .slide-sidebar {
    width: 160px;
  }

  .sidebar-header {
    padding: 0.75rem 0.5rem 0.5rem 3rem;
  }

  .sidebar-header h3 {
    font-size: 0.85rem;
  }

  .slide-link {
    padding: 0.4rem 0.5rem;
    font-size: 0.7rem;
  }

  .slide-number {
    min-width: 1.25rem;
  }
}

@media (max-width: 480px) {
  .slide-sidebar {
    width: 140px;
  }
}

/* ============================================
   AI DISCLAIMER STYLES
   ============================================ */

/* AI Disclaimer link in chat messages */
.ai-disclaimer-link {
  display: block;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ai-disclaimer-link:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* AI Disclaimer popup overlay */
.ai-disclaimer-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ai-disclaimer-popup.visible {
  opacity: 1;
  visibility: visible;
}

/* AI Disclaimer popup content */
.ai-disclaimer-content {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  max-width: 450px;
  margin: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.ai-disclaimer-popup.visible .ai-disclaimer-content {
  transform: scale(1);
}

.ai-disclaimer-content h3 {
  margin: 0 0 1rem 0;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.ai-disclaimer-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* AI Disclaimer close button */
.ai-disclaimer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.ai-disclaimer-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
