/* --- SLIDESHOW INFO BAR & SEARCH SUMMARY (Extracted from _slideshow-base.css) --- */

/* Fullscreen Mode Override: Horizontal strip at the top
   Now constrained to the left portion of the screen, flush-left, and centered text within that area */
/* Animated pop-in from the left when entering FS mode */
.slideshow-overlay.fs-mode .slideshow-info-bar {
    /* Fixed position at bottom in FS mode so category/year/search summary sits below the main poster */
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 60% !important;
    max-width: 60% !important;
    right: auto !important;
    height: 146px !important;
    min-height: 146px !important;
    box-sizing: border-box;

    background-color: rgba(250,250,245,0.10) !important;
    color: #111 !important;

    border-radius: 12px !important;
    padding: 10px 16px !important;

    box-shadow: 0 6px 18px rgba(0,0,0,0.15) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    gap: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: auto;
    z-index: 30001;

    /* Use opacity/transform-only animation so content updates don't trigger reflow */
    animation: fsInfoSlideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: opacity, transform;
    transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22,1,0.36,1);
    overflow: hidden;
}

/* Keyframes: slide in from left with a subtle overshoot then settle */
@keyframes fsInfoSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-120%) scaleX(0.98);
  }
  60% {
    opacity: 1;
    transform: translateX(8%) scaleX(1.02);
  }
  85% {
    transform: translateX(-2%) scaleX(0.995);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scaleX(1);
  }
}

.slideshow-info-bar {
    position: fixed;
    top: 55px; 
    left: var(--slideshow-poster-center-x, 50%); 
    transform: translateX(-50%);
    z-index: 30001; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Adjusted to 15px */
    padding: 0 15px; /* Added 15px padding on left and right */
    max-width: 90%;
    flex-wrap: nowrap; /* Force single-line layout */
    pointer-events: none;
    transform-origin: top center;
    font-size: 1.05rem;
}

/* Explicit order */
.slideshow-info-bar #ssThumbWrapper { order: 1; }
.slideshow-info-bar #ssSearchSummary { order: 2; }
.slideshow-info-bar #ssRelease { order: 3; }

.slideshow-info-bar .ss-release {
    width: 150px; /* increased by 50% */
    height: 150px;
    min-width: 150px;  
    min-height: 150px; 
    padding: 10px; /* Balanced padding to match thumb visual weight */
    box-sizing: border-box;
}

.slideshow-info-bar .ss-thumb-wrapper {
  width: 135px; /* increased by 50% */
  height: 135px;
  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; 
  background-color: rgba(255, 255, 255, 0.1); 
}

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

.slideshow-info-bar .ss-search-summary .result-count {
    font-size: calc(3.5em + 8pt);
    font-weight: 800;
    opacity: 1;
    line-height: 1;
    padding: 0 10px;
}

.slideshow-info-bar .ss-search-summary, 
.slideshow-info-bar .ss-search-summary *,
.slideshow-info-bar .ss-search-summary .ss-search-prefix,
.slideshow-info-bar .ss-search-summary .ss-search-term {
    color: #ffffff !important;
}

.ss-search-summary{
  position: static;
  top: auto;
  right: auto;
  font-family: 'Cinzel Decorative', 'Abril Fatface', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  z-index: 2;
  padding: 8px 15px; /* horizontal padding preserved */
  border-radius: 12px;
  color: var(--text-color) !important;

  /* Use a fixed content box to prevent text updates from changing layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  gap: 2px;
  transition: opacity 180ms ease, transform 220ms ease; /* only visual transitions */
  opacity: 0;
  min-width: 300px;
  max-width: calc(60% + 100px); /* increased center-column room by 100px */
  overflow: hidden;               /* clip long content instead of growing */
  text-overflow: ellipsis;
}

/* Ensure inner text won't expand parent; clamp overflow gracefully */
.ss-search-summary .ss-search-prefix,
.ss-search-summary .ss-search-term {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

.ss-search-summary::before{
  content:""; position:absolute; inset:0; background:var(--primary-color); opacity:.5; backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); border-radius:inherit; z-index:-1;
}

.ss-search-prefix{ 
    opacity:.9; 
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; 
}

.ss-search-term{ 
    font-family: 'Cinzel Decorative', 'Abril Fatface', cursive;
    font-size: 1em; 
    line-height:1.1; 
    margin-bottom: 2px; 
    letter-spacing: 0.12em;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Fullscreen: keep the center title at a fixed 30pt, single line with ellipsis so it never wraps or stretches the bar */
.slideshow-overlay.fs-mode .ss-search-term {
    font-size: 30pt;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-subject-role {
    color: #ffffff !important; 
    font-size: 1.2rem; 
    font-weight: 600;
    text-align: center;
    opacity: 1;
    margin-top: 0; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.ss-subject-role-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.ss-subject-name {
    font-size: 1rem; /* roughly 4pt smaller than the base 1.2rem */
    font-weight: 600;
    margin-bottom: 2px;
}

.ss-role-line {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.ss-role-character {
    font-size: calc(1.2rem + 4pt); /* 4 points larger than before */
    font-weight: 700;
}

/* Animated per-letter entry for character name */
.role-char-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    animation: roleCharIn 0.5s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes roleCharIn {
    0%   { opacity: 0; transform: translateY(8px); }
    60%  { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 1; transform: translateY(0); }
}

.ss-role-connector {
    font-weight: 400;
    opacity: 0.8;
    margin: 0 4px;
    font-style: italic;
    font-size: 0.9em;
}

.ss-release {
  position: static; 
  top: auto;
  right: auto;
  font-size: 1.2rem; 
  font-weight: 700;
  z-index: 2;
  display: flex; 
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 12px;
  color: var(--text-color) !important;
  transition: opacity 0.5s ease; 
  opacity: 1; 
  line-height: 0.9;
  min-width: 80px;
}

/* Inline two-part year (first two digits visually smaller, top-aligned with last two) */
.release-year-inline {
    display: inline-flex;
    align-items: flex-start; /* top-align parts on same baseline */
    gap: 1px; 
    line-height: 1;
    justify-content: center;
    border: 1px solid var(--primary-color);
    padding: 3px;
    border-radius: 4px;
}

/* Shared part styling */
.release-year-part {
    font-family: 'Roboto', sans-serif;
    font-weight: 800;
    color: var(--primary-color) !important;
    text-shadow: 2px 2px 0px #000;
    display: inline-block;
    backface-visibility: hidden;
    transform-origin: center center;
    animation: yearFlip 0.7s ease-out forwards;
}

/* First two digits - increased by 30% */
.release-year-part--small {
    font-size: 2.55rem; /* was 1.96rem -> increased ~30% */
    align-self: flex-start; /* ensure tops align */
    margin-top: 0; /* remove nudge so tops flush */
    animation-delay: 0.05s;
}

/* Last two digits - increased by 30% */
.release-year-part--large {
    font-size: 3.64rem; /* was 2.8rem -> increased ~30% */
    align-self: flex-start;
    animation-delay: 0.12s;
}

@keyframes yearFlip {
    0% {
        transform: rotateX(90deg);
        opacity: 0;
    }
    40% {
        transform: rotateX(-10deg);
        opacity: 1;
    }
    70% {
        transform: rotateX(5deg);
        opacity: 1;
    }
    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}

.ss-search-prefix .credits-remaining-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Base size for 1-digit position */
  width: 54px; 
  height: 54px;
  min-width: 54px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #ffffff !important;
  font-size: 3.4rem;
  border: none;
  font-weight: 800;
  margin-left: 0;
  margin-right: 15px; 
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  line-height: 1;
  vertical-align: middle;
  /* Reserved spacing for digit positions with smooth transitions */
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

/* Scale and add spacing for two number positions (10-99) */
.ss-search-prefix .credits-remaining-badge.two-digit {
  width: 82px; 
  min-width: 82px;
  border-radius: 27px; /* Transforms into a balanced pill shape */
  font-size: 3rem;
}

/* Scale and add spacing for three number positions (100+) */
.ss-search-prefix .credits-remaining-badge.three-digit {
  width: 110px;
  min-width: 110px;
  border-radius: 27px;
  font-size: 2.6rem;
}

@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;
}

@media (max-width: 768px) {
    .slideshow-info-bar {
        gap: 10px;
        top: 55px;
        flex-wrap: nowrap; 
    }
    .slideshow-info-bar .ss-thumb-wrapper {
        width: 128px; /* 85 * 1.5 ≈ 127.5 -> rounded to 128 */
        height: 128px;
        padding: 0;
    }
    .slideshow-info-bar .ss-release {
        width: 128px;
        height: 128px;
        min-width: 128px;
        min-height: 128px;
        padding: 6px;
    }
    .ss-search-summary,
    .ss-release {
        font-size: 1.05rem; 
        padding: 6px 8px;
    }
    .slideshow-info-bar .ss-search-summary .result-count {
        font-size: calc(2.1em + 16pt);
    }
    .ss-search-summary {
        gap: 1px; 
    }
    .ss-search-prefix .credits-remaining-badge {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 2rem;
        margin-right: 10px;
    }
    .ss-search-prefix .credits-remaining-badge.two-digit {
        width: 54px;
        min-width: 54px;
    }
    .ss-search-prefix .credits-remaining-badge.three-digit {
        width: 72px;
        min-width: 72px;
    }
    .ss-subject-role {
        font-size: 0.9rem; 
        margin-top: -2px;
    }
}

@media (min-width: 769px) {
    .slideshow-info-bar .ss-search-prefix .result-count {
        font-size: calc(2.15em + 16pt);
    }
}