@use "../../mixins" as *;
@use "../../variables" as *;

.banner {
  min-height: 250px;
  display: grid;
  place-items: center;
  background-color: rgba(0, 0, 0, 0.5);

  &_title {
    color: white;
  }

  &_image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    object-fit: cover;
    height: 250px;
    opacity: 0.8;
    z-index: -1;
  }

  @include responsive(md) {
    min-height: 400px;

    &_image {
      min-height: 400px;
    }
  }
}

.speaker-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;

  @include responsive(sm) {
    grid-template-columns: repeat(2, 1fr);
  }

  @include responsive(md) {
    grid-template-columns: repeat(3, 1fr);
  }

  @include responsive(lg) {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

.speaker-section {
  margin: 3rem 0;
}

.speaker-card-detail {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 5px;
  overflow: hidden;
  padding: 10px;
  text-align: left;

  width: 100%;

  &:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }

  img {
    background: #ddd;
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: top;
    border-radius: 5px;
  }

  h4 {
    margin: 10px 0 5px;
    font-size: 16px;
  }

  p {
    font-size: 14px;
    font-weight: 300;
    color: #555;
    margin: 0.4rem 0;
  }
}

.view-bio-btn {
  width: 100%;
}

// Animations
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
  }
  to {
    transform: translateY(0);
  }
}

// Modal Styles
#speakerModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;

  .modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    max-height: 70%;
    padding: 20px;

    width: 100%;
    overflow-y: auto;
    max-width: 90%;

    z-index: 1001;

    #closeModal {
      cursor: pointer;
      background-color: $primary-color;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      position: absolute;
      top: 10px;
      right: 10px;
      transition: background-color 0.3s, transform 0.2s;

      img {
        width: 15px;
        height: 15px;
      }

      &:hover {
        background-color: rgba($color: $primary-color, $alpha: 0.7);
        transform: scale(1.1);
      }
    }

    .profile-card__header {
      display: grid;
      grid-template-columns: 1fr;

      align-items: center;
      gap: 1.5rem;
      padding-bottom: 1rem;
      text-align: left;

      @include responsive(md) {
        grid-template-columns: 0.5fr 2fr;
      }
    }

    #modalSpeakerImage {
      text-align: center;
      width: 100%;
      height: 100%;

      img {
        width: auto;
        max-width: 140px; // make it smaller
        min-height: 140px; // adjust min-height
        aspect-ratio: 1 / 1; // keep it square
        border-radius: 50%; // circular
        background: #ddd;
        object-fit: cover;
        object-position: top;
        display: inline-block; // center nicely
      }
    }

    h4 {
      margin-bottom: 15px;
      color: $gray-light-color;
      font-size: 0.75rem;
    }

    .topic {
      font-style: italic;
      color: $primary-color;
      font-weight: 600;
    }

    p {
      margin-bottom: 10px;
      color: #444;
    }

    // Responsive adjustments
    @include responsive(md) {
      width: 90%;

      h4 {
        font-size: 1.2rem;
      }
      p {
        font-size: 0.9rem;
      }

      #closeModal {
        width: 25px;
        height: 25px;

        img {
          width: 12px;
          height: 12px;
        }
      }
    }

    @include responsive(sm) {
      padding: 40px;

      h2 {
        font-size: 1.2rem;
      }
      h4 {
        font-size: 1rem;
      }
      p {
        font-size: 0.85rem;
      }

      #closeModal {
        width: 20px;
        height: 20px;

        img {
          width: 10px;
          height: 10px;
        }
      }
    }

    @include responsive(lg) {
      max-width: 70%;
    }
    @include responsive(xl) {
      max-width: 60%;
    }

     @include responsive(2xl) {
      max-width: 50%;
    }
  }
}
