:root {
  --toolbar-padding: 20px;
  --toolbar-spacing: 20px;
  --color-background: #080A0C;
  --color-text-primary: #FFFFFF;
  --color-text-secondary: rgba(255, 255, 255, 0.50);
  --info-spacing: 15px;
  --min-width: 350px;
  --min-thumbnail-height: 560px;
  --bottom-wrapper-height: 90px;
}

@media (max-width: 700px) {
  :root {
    --min-thumbnail-height: 350px;
  }
}

body {
  margin: 0;
  font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--color-background);
  color: #e6eef0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  height: auto;
  min-width: var(--min-width);
  overflow-x: hidden;
  overflow-y: auto;
}

.detail-container {
  width: 100%;
  max-width: 800px;
  min-width: var(--min-width);
  height: auto;
  background: var(--color-background);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-bottom: var(--bottom-wrapper-height);
}

.thumbnail-wrapper {
  width: 100%;
  height: 55vh;
  min-height: var(--min-thumbnail-height);
  position: relative;
  overflow: hidden;
}

.thumbnail-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 190px;
  background: linear-gradient(to bottom, #080A0C00 0%, #080A0CFF 100%);
  pointer-events: none;
  z-index: 1;
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.thumbnail.fading {
  opacity: 0;
}

.toolbar {
  position: absolute;
  top: var(--toolbar-padding);
  padding: 0 var(--toolbar-padding);
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.right-group {
  display: flex;
  gap: var(--toolbar-spacing);
}

.thumbnail-text {
  position: absolute;
  bottom: var(--toolbar-padding);
  left: var(--toolbar-padding);
  right: var(--toolbar-padding);
  color: var(--color-text-primary);
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6); /* optional for readability */
  z-index: 2;
}

.thumbnail-text .title {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
}

.thumbnail-text .subtitle {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-row {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 16px;
  gap: var(--info-spacing);
  padding: 0 var(--toolbar-spacing);
  box-sizing: border-box;
}

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

.info-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.info-subtitle {
  margin: 1px 0 0;
  font-size: 18px;
  font-weight: normal;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-title {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: normal;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.divider {
  width: 90%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 12px 0;
  align-self: center;
}

#start-conversation-button {
    margin-bottom: 15px;
}

/* Hide desktop button on mobile */
.desktop-button-wrapper {
  display: none;
}

/* Desktop responsive layout */
@media (min-width: 1200px) {
  body {
    overflow: hidden;
  }

  .detail-container {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    padding-bottom: 0;
    min-width: unset;
  }

  .detail-content {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    gap: 0;
    align-items: stretch;
  }

  .left-section {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
  }

  .thumbnail-wrapper {
    width: 100%;
    height: 100%;
    min-height: unset;
    flex: 1;
    position: relative;
  }

  .thumbnail-wrapper::after {
    height: 200px;
  }

  /* Hide mobile button on desktop */
  .mobile-button-wrapper {
    display: none;
  }

  .info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    padding-bottom: 40px;
    justify-content: flex-start;
    overflow-y: auto;
    height: 100%;
    position: relative;
    box-sizing: border-box;
  }

  .desktop-button-wrapper {
    display: block;
    margin-top: auto;
    padding-top: 30px;
    padding-bottom: 20px;
    flex-shrink: 0;
  }

  .desktop-button-wrapper .primary-button {
    pointer-events: auto;
    width: 100%;
    padding: 20px 0;
    border: none;
    border-radius: 32px;
    font-size: 18px;
    font-weight: bolder;
    color: #fff;
    background: linear-gradient(90deg, #0239E9, #73ACEB);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    min-width: 0;
  }

  .desktop-button-wrapper .primary-button:hover,
  .desktop-button-wrapper .primary-button:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  }

  .info-row {
    padding: 0;
  }

  .divider {
    display: none;
  }

  .thumbnail-text {
    bottom: calc(var(--toolbar-padding) + 40px);
    left: calc(var(--toolbar-padding) + 15px);
    right: var(--toolbar-padding);
  }

  .thumbnail-text .title {
    font-size: 32px;
  }

  .thumbnail-text .subtitle {
    font-size: 18px;
  }
}