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

:root {
  --color-primary: #000;
  --color-primary-hover: #333;
  --color-text: #1a1a1a;
  --color-text-light: #666;
  --color-text-muted: #999;
  --color-background: #f5f5f7;
  --color-white: #fff;
  --color-border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

.gradient-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 18px;
  background: linear-gradient(to right, #21DAFF 0%, #74EC8D 20%, #E0FF20 40%, #EBB016 60%, #FF5C1A 80%, #FF1A6A 100%);
  z-index: 100;
}

.header {
  background: var(--color-white);
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
  margin-top: 18px;
  position: sticky;
  top: 18px;
  z-index: 50;
}

.container {
  width: 100%;
  padding: 0 24px;
}

.logo {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.logo-separator { margin: 0 8px; color: var(--color-text-muted); font-weight: 300; }
.logo-subtitle { font-size: 1.45rem; font-weight: 400; color: var(--color-text-light); }

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.congress-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background-image: linear-gradient(to top, rgb(115, 236, 143), rgb(157, 243, 100));
  border-radius: 10px;
}

.congress-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.congress-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: right;
}

.congress-info-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #0f3d1f;
  opacity: 0.85;
}

.congress-info-dates {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f3d1f;
}

.congress-info-cta {
  display: inline-flex;
  align-items: center;
  border: 1px solid #0f3d1f;
  background: #fff;
  color: #0f3d1f;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.congress-info-cta:hover {
  background: #0f3d1f;
  border-color: #0f3d1f;
  color: #fff;
}

.main-content { padding: 18px 0 80px; }
.section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.view-section { margin-top: 10px; }
.hidden { display: none !important; }

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

.listing-header-row .section-title {
  margin-bottom: 0;
}

.favorites-view-toggle {
  font-family: inherit;
  font-size: 0.82rem;
  min-height: 34px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 10px;
}

.toolbar-global {
  margin: 12px 0 2px;
}

@media (min-width: 769px) {
  .header-top-row + .toolbar-global {
    margin-top: 20px;
  }
}

.toolbar-global .btn-send {
  height: 42px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 600;
}

.search-input, .session-select {
  height: 42px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--color-text);
}

.search-input { flex: 1; min-width: 260px; }
.session-select { min-width: 220px; }

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(640px, 2fr);
  grid-template-areas: "chat listing";
  gap: 18px;
  align-items: start;
}

.listing-pane {
  grid-area: listing;
}

.chat-pane-shell {
  grid-area: chat;
}

.congress-info-chat {
  margin-bottom: 10px;
}

.chat-mobile-toggle {
  border: 0;
}

.mobile-accordion > summary {
  list-style: none;
}

.mobile-accordion > summary::-webkit-details-marker {
  display: none;
}

.mobile-accordion > summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.mobile-accordion:not([open]) > summary::after {
  content: "▸";
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  justify-content: stretch;
  gap: 18px;
}

.video-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  transition: var(--transition);
}

.video-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-bottom: 12px;
  background: linear-gradient(135deg, #0f172a 0%, #111827 55%, #1f2937 100%);
}

.video-thumb-button {
  display: block;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.video-thumb-button:visited,
.video-thumb-button:active {
  color: inherit;
  text-decoration: none;
}

.video-thumb-button:hover .video-thumb-play {
  transform: scale(1.05);
}

.video-thumb-button:focus-visible {
  outline: 3px solid #21DAFF;
  outline-offset: 2px;
}

.video-thumb {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.video-thumb::before {
  content: "";
  position: absolute;
  inset: -18px;
  background-image:
    linear-gradient(rgba(10, 14, 24, 0.58), rgba(10, 14, 24, 0.58)),
    url("/static/assets/fond.webp");
  background-size: cover;
  background-position: center;
  filter: blur(6px) saturate(0.82);
  transform: scale(1.2);
}

.video-thumb > * {
  position: relative;
  z-index: 1;
}

.video-thumb-play {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  padding-left: 3px;
  transition: transform 120ms ease;
}

.video-thumb-label {
  font-size: 0.72rem;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.video-session {
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.video-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.video-meta { font-size: 0.84rem; color: var(--color-text-light); margin-bottom: 10px; }
.video-resume-preview {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  cursor: pointer;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-resume-preview::after {
  content: " ...";
  color: var(--color-text-muted);
}

.video-resume-preview.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.video-resume-preview.expanded::after {
  content: "";
}

.video-resume-toggle-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-light);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.video-resume-preview.expanded .video-resume-toggle-indicator {
  color: #fff;
  background: #111827;
  border-color: #111827;
  font-size: 0;
}

.video-resume-preview.expanded .video-resume-toggle-indicator::before {
  content: "−";
  font-size: 0.95rem;
  line-height: 16px;
}

.video-points-list {
  margin: 8px 0 12px 18px;
  color: var(--color-text-light);
  font-size: 0.84rem;
}

.video-points-list li {
  margin-bottom: 6px;
}

.btn-open-player, .btn-focus-video {
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  height: 32px;
  padding: 0 10px;
  font-size: 0.77rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-open-player:hover, .btn-focus-video:hover { background: #f8fafc; }

.video-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-video-sheet {
  border: 1px solid #000;
  background: #fff;
  color: #000;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-video-sheet:visited,
.btn-video-sheet:active {
  color: #000;
  text-decoration: none;
}

.btn-video-sheet:hover {
  background: #f3f4f6;
}

.btn-video-sheet:focus-visible {
  outline: 3px solid #21DAFF;
  outline-offset: 2px;
}

.empty-state {
  background: var(--color-white);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  padding: 22px;
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.chat-pane {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  height: calc(100dvh - 220px);
  min-height: 420px;
  max-height: 860px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.pane-title { font-size: 0.85rem; font-weight: 600; }
.pane-disclaimer {
  margin-top: 4px;
  font-size: 0.73rem;
  color: var(--color-text-light);
}

.chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(
      135deg,
      rgba(33, 218, 255, 0.08) 0%,
      rgba(116, 236, 141, 0.07) 20%,
      rgba(224, 255, 32, 0.06) 40%,
      rgba(235, 176, 22, 0.05) 60%,
      rgba(255, 92, 26, 0.05) 80%,
      rgba(255, 26, 106, 0.05) 100%
    ),
    #fafafa;
}

.chat-message {
  max-width: 92%;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  border: 1px solid transparent;
  word-break: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background: #eef6ff;
  border-color: #d8e7ff;
}

.chat-message.assistant {
  align-self: flex-start;
  background: var(--color-white);
  border-color: var(--color-border);
}

.chat-message h4 { font-size: 0.86rem; margin-bottom: 4px; }
.chat-message ul { margin: 6px 0 0 18px; }
.chat-message p + p, .chat-message ul + p { margin-top: 6px; }

.chat-video-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.btn-play-video {
  border: 1px solid #000;
  background: #000;
  color: #fff;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-play-video:hover {
  background: #222;
  border-color: #222;
}

.btn-play-video.btn-favorite-toggle {
  background: #fff;
  border-color: #d1d5db;
  color: #111827;
}

.btn-play-video.btn-favorite-toggle:hover {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.btn-play-video.btn-favorite-toggle.is-active {
  background: #facc15;
  border-color: #eab308;
  color: #713f12;
}

.btn-play-video.btn-favorite-toggle.is-active:hover {
  background: #eab308;
  border-color: #ca8a04;
  color: #713f12;
}

.btn-play-video:focus-visible {
  outline: 3px solid #21DAFF;
  outline-offset: 2px;
}

.chat-video-link {
  vertical-align: middle;
  margin: 0 4px;
}

.chat-form {
  border-top: 1px solid var(--color-border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.chat-input {
  width: 100%;
  min-height: 72px;
  resize: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
}

.chat-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn-send {
  border: none;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  height: 34px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-send:hover { background: var(--color-primary-hover); }

.pagination {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: #111;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.page-link:hover {
  background: #f3f6fa;
}

.page-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-info {
  font-size: 0.82rem;
  color: #475467;
}

.focus-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: #000;
}

.focus-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.focus-meta {
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.focus-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.focus-subtitle { font-size: 0.8rem; color: var(--color-text-light); }
.focus-resume {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--color-text);
  line-height: 1.45;
}

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

.floating-player {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(460px, calc(100vw - 24px));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.floating-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-close-btn {
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--color-text-light);
  text-decoration: underline;
}

.video-page-back {
  margin-top: 12px;
}

.video-page-main .container {
  max-width: 1320px;
  margin: 0 auto;
}

.video-page-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.video-page-player-shell {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #000;
  margin-bottom: 14px;
}

.video-page-media {
  display: flex;
  flex-direction: column;
}

.video-page-player-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-page-title {
  font-size: 1.45rem;
  line-height: 1.35;
  margin-bottom: 8px;
}

.video-page-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 12px;
}

.video-page-resume {
  font-size: 0.96rem;
  line-height: 1.6;
}

.video-page-points-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.video-page-points-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.video-page-points-list {
  margin: 0 0 0 20px;
  font-size: 0.9rem;
  color: var(--color-text);
}

.video-page-points-list li {
  margin-bottom: 6px;
}

.video-page-desclong-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.video-page-desclong {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
}

.video-related-section {
  margin-top: 18px;
}

.video-related-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.video-related-title {
  font-size: 1.02rem;
  font-weight: 600;
}

.video-related-subtitle {
  font-size: 0.84rem;
  color: var(--color-text-light);
}

.video-related-resume {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 1201px) {
  .video-page-meta {
    order: 1;
  }
  .video-page-media {
    order: 2;
  }
}

@media (min-width: 901px) {
  .mobile-accordion > summary {
    display: none;
  }
  .chat-mobile-toggle > .chat-pane,
  .chat-mobile-toggle:not([open]) > .chat-pane {
    display: flex;
  }
}

@media (max-width: 1200px) {
  .workspace-layout {
    grid-template-columns: minmax(300px, 1fr) minmax(520px, 2fr);
    gap: 14px;
  }
  .search-input { min-width: 220px; }
  .session-select { min-width: 180px; }
  .video-page-card {
    grid-template-columns: 1fr;
  }
  .video-page-meta {
    order: 1;
  }
  .video-page-media {
    order: 2;
  }
}

@media (max-width: 900px) {
  .workspace-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chat"
      "listing";
  }

  .mobile-accordion {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .mobile-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid transparent;
  }

  .mobile-accordion[open] > summary {
    border-bottom-color: var(--color-border);
  }

  .chat-mobile-toggle > .chat-pane {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    height: min(62dvh, 520px);
  }

  .chat-mobile-toggle > .chat-pane .pane-header {
    display: none;
  }

  .chat-pane-shell {
    margin-bottom: 4px;
  }
  .congress-info-chat {
    margin-bottom: 8px;
  }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .logo, .logo-subtitle { font-size: 1.2rem; }
  .logo-subtitle, .logo-separator { display: none; }
  .header-top-row {
    align-items: flex-start;
    gap: 10px;
  }
  .congress-info {
    width: 100%;
    justify-content: space-between;
    padding: 8px 10px;
  }
  .congress-icon {
    width: 30px;
    height: 30px;
  }
  .congress-info-text {
    text-align: left;
  }
  .congress-info-dates {
    font-size: 0.85rem;
  }
  .header {
    position: static;
    top: auto;
    padding: 14px 0;
  }
  .main-content { padding-top: 12px; }
  .toolbar-global { margin-top: 10px; }
  .search-input { min-width: 100%; }
  .session-select { min-width: calc(50% - 6px); }
  .toolbar-global .btn-send {
    width: 100%;
    height: 42px;
  }
  .videos-grid { grid-template-columns: 1fr; }
  .chat-actions { flex-direction: column; align-items: flex-start; }
  .btn-send { width: 100%; }
  .video-page-title { font-size: 1.2rem; }
  .video-related-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .listing-header-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .floating-player {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 8px;
    padding: 8px;
    max-height: calc(100dvh - 12px);
  }
  .focus-meta {
    padding: 8px 10px;
    max-height: 38dvh;
    overflow-y: auto;
  }
  .focus-resume {
    max-height: 28dvh;
    overflow-y: auto;
  }
}
