/* --- BASE MODAL SYSTEM & STANDALONE TRAILER --- */

.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: flex-start; /* Align content toward the top */
  justify-content: center;
  z-index: 40000;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background-color: var(--background-color);
    margin-top: 5vh; /* 5% from top */
    width: 95%;
    max-width: 800px;
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    overflow: hidden;
}

/* --- SEARCH, INFO, PERSON PREVIEW (Extracted from _modal.css) --- */

/* Search Modal */
.search-modal-overlay {
  position: fixed; inset: 0; z-index: 50001;
  background-color: rgba(0,0,0,0.6);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 80px; /* Position the top of the search window 80px from the screen top */
}
.search-modal-content {
  background-color: rgba(20,20,20,0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--primary-color);
  border-radius: 12px; padding: 20px;
  padding-top: 10px;
  width: 90%; max-width: 500px; box-sizing: border-box;
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
}
.search-modal-content #searchModalInput { padding: 10px; font-size: 1rem; }
.search-modal-content #searchModalButton {
  padding: 10px 16px; font-size: 1rem;
  background: var(--primary-color); color: #000 !important; border: none; border-radius: 8px; cursor: pointer;
}

.search-modal-logo {
  grid-column: 1 / -1; justify-self: center; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.search-modal-logo::before {
  content: 'SEARCH'; color: var(--primary-color); font-size: 1.54rem; font-weight: 700; white-space: nowrap;
}
.search-modal-logo::after {
  content: none;
}

/* NEW: Styles for the graphic part of the search logo */
.search-logo-graphic {
    width: min(42vw, 210px); 
    height: 40px;
    
    /* Logo definition (moved from ::after) */
    background-color: var(--primary-color);
    -webkit-mask-image: url('6d-300.png'); -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain;
    mask-image: url('6d-300.png'); mask-repeat: no-repeat; mask-position: center; mask-size: contain; 
    display: block;

    /* Enable shine animation / reflection clipping */
    position: relative;
    overflow: hidden;
}

/* Shine effect (copied from base.css .logo::after) */
.search-logo-graphic::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0) 60%
    );
    opacity: 0;
    transform: translate(-150%, -150%) rotate(25deg);
}

/* Animation trigger classes (copied from base.css .logo classes) */
.search-logo-graphic.logo-reflect-right::after {
    animation: logoDiagonalShine 2.8s ease-out forwards;
}
.search-logo-graphic.logo-reflect-left::after {
    animation: logoDiagonalShineReverse 2.8s ease-out forwards;
}

.search-modal-content #searchModalInput { 
  padding: 10px; 
  font-size: 1rem; 
  width: 80%; /* 20% smaller */
  justify-self: center; /* Center horizontally in the 1fr column */
}

/* Info Modal */
.info-modal-overlay {
  position: fixed; inset: 0; z-index: 50002; background-color: rgba(0, 0, 0, 0.65); display: none; align-items: center; justify-content: center;
}
.info-modal-content {
  position: relative; width: 90%; max-width: 520px; max-height: 85vh;
  background-color: rgba(20, 20, 20, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 14px; border: 1px solid var(--primary-color);
  box-shadow: 0 8px 28px rgba(0,0,0,0.7); padding: 26px 26px 22px 26px; overflow-y: auto; scrollbar-width: none;
}
.info-modal-content::-webkit-scrollbar { display: none; }

.info-close-button {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--primary-color); color: #000000; font-size: 1.6rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.info-close-button:hover { transform: scale(1.06); box-shadow: 0 4px 12px rgba(0,0,0,0.6); opacity: 0.9; }

.info-logo-wrapper { display: flex; justify-content: center; margin-bottom: 12px; margin-top: 6px; }
.info-logo-img {
  width: 300px; height: 57px; background-color: var(--primary-color);
  -webkit-mask-image: url('6d-300.png'); -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain;
  mask-image: url('6d-300.png'); mask-repeat: no-repeat; mask-position: center; mask-size: contain;
}
.info-title {
  margin: 6px 0 12px 0; text-align: center; font-size: 1.35rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--lighter-primary-color) !important; text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}
.info-feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.info-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.4));
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: 1px solid rgba(var(--primary-color-rgb), 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}

/* Compact state for non-selected items when one is expanded */
.info-feature-list li.collapsed-small {
  opacity: 0.6;
  transform: scale(0.97);
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Expanded state */
.info-feature-list li.expanded {
  transform: scale(1.02);
}

/* Hidden extra content container by default */
.info-extra {
  display: none;
  margin-top: 8px;
  width: 100%;
}

/* Show extra content when expanded */
.info-feature-list li.expanded .info-extra {
  display: block;
}

/* Specific styling for the color options image in item 5 */
.info-extra-colors img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  display: block;
  cursor: pointer;
}

/* Full-screen zoom overlay for info images (e.g., color options) */
.info-image-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 60000;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-image-zoom-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
}

/* Keep bullet styling below */
.info-bullet {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-color); color: #000000 !important;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; box-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.7);
}
.info-text { font-size: 0.95rem; line-height: 1.4; color: #ffffff !important; }

/* Person Image Preview */
.person-image-preview {
    position: absolute; display: none; z-index: 20002;
    height: 150px; width: auto; overflow: hidden; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    pointer-events: none; transform: translate(10px, -50%); opacity: 0; transition: opacity 0.2s ease;
    border: 1px solid var(--primary-color);
}
.person-image-preview img { height: 100%; width: auto; object-fit: cover; transition: transform 0.3s ease; }
.person-image-preview:hover img { animation: floatSlow 3s ease-in-out infinite; }

/* Standalone Trailer Modal (Always on Top Popup) */
.trailer-modal {
  z-index: 90000 !important; /* Above everything else */
  display: none;
  align-items: flex-start; 
  justify-content: center;
  /* Make overlay more transparent so page content is clearly visible beneath */
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
}

.trailer-modal-content {
  margin-top: 15px; /* Fixed small top margin */
  width: 95%;
  max-width: 850px;
  background-color: rgba(10, 10, 10, 0.98) !important;
  border: 2px solid var(--primary-color) !important;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.9) !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Cap height to half screen as requested */
  height: auto;
  max-height: 50vh; 
  z-index: 90001;
  border-radius: 12px;
  overflow: hidden;
}

/* Ensure the video container inside trailer modal is sized well */
.trailer-modal .video-container {
  margin-top: 0;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 35vh; /* Scale video to fit within half-screen content */
}

.trailer-duration-line {
  color: var(--lighter-primary-color);
  font-weight: 600;
  margin: 10px 0;
  font-size: 0.9rem;
}

/* Slideshow Preview Modal */
.slideshow-preview-modal { 
    z-index: 90000 !important;
}

@media (max-width: 480px) {
  .search-logo-graphic { width: 105px; height: 30px; }
  .search-modal-logo::before { font-size: 1.05rem; }
}
@media (max-width: 768px) {
  .info-modal-content { width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; padding: 20px 18px 24px 18px; }
  /* Mobile preview: compact top-aligned half-screen window */
  .slideshow-preview-modal .modal-content {
    margin: 15px auto;
    width: calc(100% - 30px);
    max-width: none;
    height: auto;
    max-height: 50vh;
    border-radius: 12px;
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
}
@media (min-width: 769px) {
    .person-image-preview { height: 300px; }
    /* Desktop preview: centered top-aligned compact window */
    .slideshow-preview-modal .modal-content {
      margin: 20px auto;
      width: 60%;
      max-width: 900px;
      height: auto;
      max-height: 50vh;
      border-radius: 12px;
      padding-bottom: 15px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
    }
}


