/**
 * Agenda Consolidated Styles
 * Scope: .single-agenda and .post-type-archive-agenda
 */

.single-agenda,
.post-type-archive-agenda {
  /* 1. Shared Variables */
  --transition-speed: 0.3s;
  --transition-timing: ease-in-out;
  --brand-blue-shadow: rgba(37, 45, 113, 0.1);
  --brand-blue-shadow-inner: rgba(37, 45, 113, 0.04);
  --category-pill-bg: rgba(var(--bs-primary-rgb), 0.1);
  --category-pill-text: rgba(var(--bs-primary-rgb), 0.8);

  /* 2. Hero Section - Unified background logic */
  .hero-section {
    background: linear-gradient(38deg, transparent 51.08%, rgba(50, 61, 184, 0.3) 100%),
      url("../../img/pattern-randomized.svg") center/cover;
    align-content: center;


    .event-card .event-thumb {
      width: 90px;
      height: 90px;
      object-fit: cover;
    }
  }

  /* 3. Suggestion Cards - Shared across both templates */
  .agenda-suggestion-card {
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid #e0e0e0;
    background: #fff;
    display: flex;
    flex-direction: column;
    text-decoration: none;

    .title,
    .excerpt {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .title {
      -webkit-line-clamp: 2;
    }

    .excerpt {
      -webkit-line-clamp: 3;
    }

    &:hover {
      transform: translateY(-5px);
      box-shadow: 0 20px 25px -5px var(--brand-blue-shadow),
        0 10px 10px -5px var(--brand-blue-shadow-inner) !important;
      text-decoration: none;
    }
  }

  /* 4. Category Badges/Pills */
  .category-pill,
  .session-category-pills .pill {
    background-color: var(--category-pill-bg);
    color: var(--category-pill-text);
    font-size: 0.875rem;
    padding: 0.25rem 1rem;
    border-radius: 50rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
  }

  /* 5. Video Player (Modern Aspect Ratio) */
  .yt-lite {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000 center/cover no-repeat;
    border-radius: 12px;
    overflow: hidden;

    iframe,
    .yt-fallback,
    .yt-play {
      position: absolute;
      inset: 0;
      /* Modern shorthand for top/right/bottom/left */
      width: 100%;
      height: 100%;
      border: 0;
    }
  }

  /* 6. Transcript Animation */
  .transcript-collapsed {
    max-height: 250px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.5s var(--transition-timing);

    &::after {
      content: "";
      position: absolute;
      inset: auto 0 0 0;
      height: 80px;
      background: linear-gradient(transparent, #f8f9fa);
      /* Match your page bg */
      pointer-events: none;
    }
  }

  .transcript-expanded {
    max-height: 5000px;

    &::after {
      opacity: 0;
    }
  }
}

/**
 * Archive Specific Styles
 */
.post-type-archive-agenda {
  .mt--5 {
    margin-top: -6rem !important;
  }

  /* Dropdown Core */
  .dropdown-menu {
    border: 0;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    margin-top: 10px !important;
    animation: fadeInDown 0.2s ease-out;
  }

  /* Category List inside Dropdown */
  #category-checkbox-list {
    border-top: 1px solid #dee2e6;
    padding-top: 0.5rem;

    /* Modern Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;

    &::-webkit-scrollbar {
      width: 5px;
    }

    &::-webkit-scrollbar-thumb {
      background: #ccc;
      border-radius: 10px;
    }
  }

  .category-checkbox-item {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: background 0.2s ease;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;

    /* Change background when checked */
    &:has(.category-checkbox:checked) {
      background: rgba(var(--bs-primary-rgb), 0.08);
      font-weight: 500;
    }

    /* Add a small checkmark or indicator on the right */
    &::after {
      content: 'check';
      font-family: 'Material Symbols Outlined';
      position: absolute;
      right: 12px;
      font-size: 1.1rem;
      color: var(--bs-primary);
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    &:has(.category-checkbox:checked)::after {
      opacity: 1;
    }

    &:hover {
      background: rgba(var(--bs-primary-rgb), 0.05);
    }
  }

  /* Style the actual checkbox to look more integrated */
  .category-checkbox {
    cursor: pointer;
    width: 1.15em;
    height: 1.15em;
    margin-top: 0;
    border: 1.5px solid #cbd5e1;

    &:checked {
      background-color: var(--bs-primary);
      border-color: var(--bs-primary);
    }

    &:focus {
      box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.15);
      border-color: var(--bs-primary);
    }
  }

  /* 7. Mobile Viewport Adjustments */
  @media (max-width: 768px) {

    /* The Full-Width Fix */
    #sessions-filter-form .dropdown {
      position: static !important;
    }

    #sessions-filter-form .dropdown-menu {
      position: absolute !important;
      left: 15px !important;
      right: 15px !important;
      width: auto !important;
      transform: none !important;
      z-index: 1060;
    }

    /* Form Layout on Mobile */
    #sessions-filter-form {
      .col-md-6 {
        margin-bottom: 0.5rem;
      }

      /* Make search & filter buttons full width */
      .d-flex.gap-3 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem !important;
      }

      #category-dropdown {
        width: 100%;
        display: flex;
        justify-content: space-between;
      }
    }

    /* Mobile Interaction Enhancements */
    .category-checkbox-item {
      padding: 0.8rem 0.6rem !important;
      /* Larger touch targets */
    }

    #category-search {
      font-size: 16px;
    }

    /* Prevent iOS zoom */
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.speaker-list {
  row-gap: 1rem;
  list-style: none;

  li {
    .img-section {
      position: relative;
      /* Context for absolute linkedin icon */

      .speaker-img {
        display: block;
        width: 70px;
        height: 70px;
        border: 2px solid transparent;
        transition: border-color var(--transition-speed) ease;
      }

      .linkedin {
        position: absolute;
        bottom: 0;
        right: -10%;
        opacity: 0;
        transition: all 200ms ease-in-out;
      }

      &:hover {
        .linkedin {
          opacity: 1;
        }

        .speaker-img {
          border-color: var(--bs-accent-100);
        }
      }
    }

    .speaker-detail {

      .designation,
      .company {
        font-size: 14px;
        line-height: 19px;
        margin: 0;
      }

      .company {
        color: #7d7d7d;
      }

      .identity {
        font-size: 10px;
        border-radius: 4px;
        padding: 1px 6px;
        text-transform: uppercase;
        display: inline-block;
        line-height: 15px;
        align-self: start;

        &.speaker,
        &.panelist,
        &.judge {
          background-color: #b1ecf7;
          color: #222dd0;
        }

        &.moderator,
        &.keynote {
          background-color: color-mix(in srgb, var(--bs-accent-50), transparent 50%);
          color: var(--bs-accent-200);
        }
      }
    }
  }
}

/* ---------- YouTube box (Modern Aspect Ratio) ---------- */
.yt-lite {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* Replaces padding-bottom hack */
  background: #000 center/cover no-repeat;
  border-radius: 12px;
  overflow: hidden;

  iframe,
  .yt-fallback,
  .yt-play {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }

  &.is-loaded {
    background-image: none;
  }
}

.yt-play {
  margin: auto;
  width: 68px;
  height: 48px;
  border-radius: 12px;
  background: rgb(0 0 0 / 60%);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--transition-speed) var(--transition-timing);

  &:hover {
    background: rgb(0 0 0 / 72%);
  }
}

.yt-play-icon {
  width: 0;
  height: 0;
  border-left: 16px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 3px;
}