/* --- SLIDESHOW TOP INFO BAR --- */

.slideshow-info-bar {
    position: fixed;
    top: 20px; 
    left: 50%; 
    transform: translateX(-50%);
    z-index: 30001; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; 
    max-width: 90%;
    flex-wrap: nowrap;
    pointer-events: none;
}

/* Order: [thumb] [info box] [date box] */
.slideshow-info-bar #ssThumbWrapper { order: 1; }
.slideshow-info-bar #ssSearchSummary { order: 2; }
.slideshow-info-bar #ssRelease { order: 3; }

/* Thumbnail */
.slideshow-info-bar .ss-thumb-wrapper {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  border: 1px solid var(--primary-color); 
  display: none; 
  position: relative;
  z-index: 30002; 
  overflow: hidden; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  flex-shrink: 0; 
  padding: 0 0 0 2px;
  background-color: rgba(255, 255, 255, 0.1); 
  margin-left: 85px;
}

.slideshow-overlay .slideshow-info-bar .ss-thumb-wrapper { margin-left: 0; }
.slideshow-info-bar .ss-thumb-wrapper.slideshow-person-link { cursor: pointer; }

.slideshow-info-bar .ss-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top; 
  border: none;
  border-radius: 5px;
  display: block;
}

/* Search Summary & Results Title */
.ss-search-summary {
  position: static;
  font-size: 1rem;
  font-weight: 600;
  z-index: 2;
  padding: 0;
  color: var(--text-color) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  gap: 12px;
  transition: opacity 0.5s ease;
  opacity: 0;
  flex: 1 1 auto;
}

.ss-search-prefix { 
    opacity:.95; 
    font-size: 0.85rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.ss-credits-label { font-size: 0.8rem; letter-spacing: 0.08em; }

.ss-search-term { 
    font-size: 1.05rem; 
    line-height:1.1; 
    margin-bottom: 0; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 15px;
    background: rgba(var(--primary-color-rgb), 0.5);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ss-search-term .category-main-term {
    font-family: 'Righteous', sans-serif;
    letter-spacing: 0.12em;
}

/* Subject Info Line ("Name is Role") */
.ss-subject-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.ss-subject-name { font-size: 1rem; font-weight: 700; text-align: center; }
.ss-subject-is { font-size: 0.9rem; font-weight: 400; }
.ss-subject-role {
    color: var(--primary-color) !important; 
    font-size: 1.45rem;
    font-weight: 600;
    text-align: center;
    white-space: normal;
    opacity: 0.95;
    margin-top: 2px;
    width: 100%;
}

/* Release Year Flip Animation */
.ss-release {
  position: static; 
  font-size: 1.2rem; 
  font-weight: 700;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 12px;
  color: var(--text-color) !important;
  transition: opacity 0.5s ease; 
  opacity: 1;
  width: 90px;
  height: 90px;
  min-width: 90px;
  min-height: 90px;
}

.slideshow-overlay .slideshow-info-bar .ss-release { transform: none; }

.ss-release .release-year {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.ss-release .release-year-top { font-size: 0.5em; line-height: 1; margin-bottom: 2px; }

.ss-release .release-year-bottom-static {
  font-size: calc(1.5em - 4px);
  text-align: center;
  min-width: 1.5em;
  line-height: 1;
  background: #1a1a1a;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  display: inline-block;
  position: relative;
}

.ss-release .release-year-bottom-static::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: rgba(0,0,0,0.4);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1);
}

.ss-flip-wrapper {
  position: relative;
  display: inline-block;
  font-size: calc(1.5em - 4px);
  line-height: 1;
  height: 1.1em;
  min-width: 1.5em;
  perspective: 400px;
  border-radius: 4px;
  background: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  color: #fff;
  text-align: center;
}

.ss-flip-top, .ss-flip-bottom, .ss-flip-bottom-static, .ss-flip-face {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  background: #1a1a1a;
  color: #fff;
  box-sizing: border-box;
  text-align: center;
}

.ss-flip-top { top: 0; border-top-left-radius: 4px; border-top-right-radius: 4px; line-height: 1; border-bottom: 1px solid rgba(0,0,0,0.4); }
.ss-flip-bottom { bottom: 0; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; line-height: 0; }
.ss-flip-bottom-static { bottom: 0; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; line-height: 0; }

.ss-flip-leaf {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 50%;
  transform-style: preserve-3d;
  transform-origin: bottom;
  animation: ssFlipDown 0.6s ease-in-out forwards;
  z-index: 10;
}

.ss-flip-face { position: absolute; left: 0; width: 100%; height: 100%; backface-visibility: hidden; background: #1a1a1a; }
.ss-flip-front { top: 0; border-top-left-radius: 4px; border-top-right-radius: 4px; line-height: 1; border-bottom: 1px solid rgba(0,0,0,0.4); }
.ss-flip-back { top: 0; transform: rotateX(180deg); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; line-height: 0; }

@keyframes ssFlipDown { 0% { transform: rotateX(0deg); } 100% { transform: rotateX(-180deg); } }

/* Badges & Sorting */
.ss-search-prefix .credits-remaining-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff !important;
  font-size: 0.95rem;
  border: 2px solid var(--primary-color);
  font-weight: 800;
  margin-right: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  line-height: 1;
  vertical-align: middle;
}

@keyframes countBump {
  0% { transform: scale(1); opacity: 0.95; }
  40% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.credits-remaining-badge.count-bump { animation: countBump 300ms ease-in-out; }

.ss-top20-badge {
  position: absolute;
  top: -1.1em;
  left: calc(50% - 30px);
  transform: translate(-100%, -10%);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.45);
  color: #ffffff;
  font-family: "Abril Fatface", cursive;
  font-size: 0.8rem;
  line-height: 1;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

[data-theme^="light"] .ss-top20-badge { background: rgba(255,255,255,0.85); color: #000000 !important; border-color: rgba(0,0,0,0.6); }

.ss-top20-seq-ball {
  position: absolute;
  top: -27px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(var(--primary-color-rgb), 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16pt;
  font-weight: 700;
  color: #ffffff !important;
  pointer-events: none;
}

.ss-seq-num-wrapper { position: relative; display: inline-flex; align-items: baseline; }
.ss-seq-hash { position: absolute; right: 100%; top: 0; font-size: 0.7em; line-height: 1; transform: translateY(-0.12em); margin-right: 1px; }
.ss-seq-num { line-height: 1; }

[data-theme^="light"] .ss-top20-seq-ball { color: #000000 !important; }

/* Themed dark background for flip digits when Top 20 badge is active */
.slideshow-info-bar:has(.ss-top20-badge) .release-year-bottom-static,
.slideshow-info-bar:has(.ss-top20-badge) .ss-flip-wrapper,
.slideshow-info-bar:has(.ss-top20-badge) .ss-flip-top,
.slideshow-info-bar:has(.ss-top20-badge) .ss-flip-bottom,
.slideshow-info-bar:has(.ss-top20-badge) .ss-flip-bottom-static,
.slideshow-info-bar:has(.ss-top20-badge) .ss-flip-face {
    background-color: color-mix(in srgb, var(--primary-color), black 85%) !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .slideshow-info-bar {
        width: calc(100% - 30px);
        max-width: calc(100% - 30px);
        left: 50%;
        transform: translateX(-50%);
        padding: 0;
        box-sizing: border-box;
        justify-content: space-between;
    }
    
   .slideshow-info-bar .ss-search-summary {
       flex: 1 1 auto;
       min-width: 0;
       max-width: calc(100% - 170px);
       gap: 1px;
   }
   
   .slideshow-info-bar #ssThumbWrapper,
   .slideshow-info-bar #ssRelease {
       flex: 0 0 auto;
   }
    
    .slideshow-info-bar .ss-thumb-wrapper {
        width: 70px; 
        height: 70px;
        padding: 0 0 0 2px;
    }
    
    .slideshow-info-bar .ss-release {
        width: 70px;
        height: 70px;
        min-width: 70px;
        min-height: 70px;
        padding: 5px;
        transform: none; 
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid var(--primary-color);
        border-radius: 8px;
    }

    .slideshow-info-bar .ss-search-summary .result-count { font-size: 1.875em; }
    .ss-subject-name { font-size: 0.85rem; }
    .ss-subject-role { font-size: 1.2rem; }

    .slideshow-info-bar:has(.ss-top20-badge) .ss-search-term { transform: translateX(50px); }
    .slideshow-info-bar:has(.ss-top20-badge) .ss-top20-seq-ball,
    .slideshow-info-bar:has(.ss-top20-badge) .ss-top20-badge {
      left: calc(50% + 50px);
    }
}

@media (min-width: 769px) {
    .slideshow-info-bar .ss-search-prefix .result-count {
        font-size: 1.25rem; 
        font-weight: 700;
    }
}