/* ============================================
   LOADING ANIMATION
============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-window {
    position: relative;
    width: 400px;
    height: 300px;
    background: #000;
    overflow: hidden;
}

.loading-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.loading-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-color);
    font-family: var(--body-font);
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
    animation: text-fade 2s ease-in-out infinite;
}

.loading-progress {
    width: 100%;
    max-width: 300px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--blue-main);
    width: 0%;
    transition: width 0.3s ease-out;
    border-radius: 2px;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

@keyframes text-fade {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* ============================================
   FONT FACE DECLARATIONS
============================================ */
@font-face {
    font-family: 'SVBasicManual';
    src: url('font/SVBasicManual.woff2') format('woff2'),
         url('font/SVBasicManual.woff') format('woff'),
         url('font/SVBasicManual.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SVBasicManualBold';
    src: url('font/SVBasicManualBold.woff2') format('woff2'),
         url('font/SVBasicManualBold.woff') format('woff'),
         url('font/SVBasicManualBold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   CSS VARIABLES
============================================ */
:root {
    --bg-color: #1E1E2E;
    --text-color: #f5f5f5;
    --accent-color: #ff98ff;
    --sidebands-color: #14141F;
    --content-max-width: 1024px;
    --content-padding: 2rem;
    --body-font: 'SVBasicManual', monospace;
    --heading-font: 'SVBasicManualBold', monospace;
    --blue-main: #3284c9;
    --blue-accent: #0987ef;
    --blue-light: #5c89fb;
    --pink-main: #ff98ff;
    --bg-main: #000;
    --blue-main-rgb: 50, 132, 201;
}

/* ============================================
   RESET CSS DI BASE
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   LANGUAGE SWITCHER
============================================ */
.bio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.language-switcher {
    display: flex;
    gap: 5px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 3px;
    font-family: var(--body-font);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: rgba(50, 132, 201, 0.3);
    border-color: rgba(50, 132, 201, 0.5);
    color: var(--text-color);
}

.bio-content {
    transition: opacity 0.3s ease;
}

/* ============================================
   LAYOUT PRINCIPALE
============================================ */
body {
    font-family: var(--body-font);
    background-color: var(--sidebands-color);
    color: var(--text-color);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    background: var(--bg-main);
}

/* ============================================
   WEB-AREA (CONTENITORE PRINCIPALE)
============================================ */
.web-area {
    background-color: rgba(30, 30, 46, 0.85);
    background-image: url('AA1.jpg');
    background-repeat: repeat;
    background-size: 50%;
    background-position: center;
    width: 100%; 
    max-width: var(--content-max-width);
    min-height: 100vh;
    padding: var(--content-padding);
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

/* Sticky footer layout */
.web-area {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page, .upload-container, .contact-container, .bio-container, .libraries-intro-text, .library-mini-grid {
  flex: 1 0 auto;
}
.global-footer-container {
  position: static;
  left: unset;
  right: unset;
  bottom: unset;
  width: 100%;
  background: transparent;
  display: block;
  pointer-events: none;
  z-index: 1000;
  min-height: 0;
}
.global-footer-container .site-footer {
  pointer-events: auto;
  background: rgba(0,0,0,0.0);
  margin-bottom: 0;
  border: none;
  box-shadow: none;
  text-align: center;
  max-width: 100%;
}
.library-mini-grid {
  padding-bottom: 0;
}
.footer-spacer {
  display: block;
}

/* ============================================
   STILE HEADER
============================================ */
header {
    text-align: center;
    margin-bottom: 0.3rem; /* Reduce space below logo */
}

header h1, .header-title {
  color: var(--blue-main);
  letter-spacing: 0.08em;
}
.header-sound-designer, .sound-designer {
  background: linear-gradient(90deg, var(--blue-accent), var(--blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  letter-spacing: 0.5em;
  font-weight: 500;
}
.subtitle {
  color: var(--blue-main);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}
.nav-menu {
  color: var(--pink-main);
}
.nav-menu a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-menu a.active, .nav-menu a:focus {
  color: var(--blue-accent);
  border-bottom: none;
}
.nav-menu a:hover {
  color: var(--blue-light);
}

/* ============================================
   MENU DI NAVIGAZIONE
============================================ */
.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.1rem 0.3rem; /* Reduced left/right margins by 0.5rem */
    font-family: var(--body-font);
    font-size: 1.3rem !important;
    letter-spacing: 0.05em;
    gap: 2rem; /* Increased gap by 0.5rem */
    flex-wrap: wrap;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    transition: all 0.3s ease;
    position: relative;
    white-space: normal;
    flex-shrink: 1;
    margin: 0;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

.nav-menu a.active {
    color: var(--accent-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.8rem;
    right: 0.8rem;
    height: 2px;
    background-color: var(--accent-color);
}

.nav-separator {
    margin: 0 0.2rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Verde smeraldo per link specifici del menu */
.nav-menu a.menu-green {
  color: var(--text-color);
  transition: color 0.2s;
}
.nav-menu a.menu-green:hover,
.nav-menu a.menu-green.active,
.nav-menu a.menu-green:focus {
  color: var(--pink-main) !important;
}
.nav-menu a.menu-green.active,
.nav-menu a.menu-green:focus {
  border-bottom: none;
}
.nav-menu a.menu-green {
  border-bottom: none;
  position: relative;
}
.nav-menu a.menu-green.active::after, .nav-menu a.menu-green:focus::after {
  content: '';
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0;
  height: 2px;
  background-color: var(--pink-main);
  border-radius: 1px;
}

/* ============================================
   LAYOUT GRIGLIA
============================================ */
.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.9rem;
    width: 100%;
    margin: 3rem auto 0; /* Reduced top margin by 0.5rem */
}

@media (max-width: 1200px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 900px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .grid-container {
    grid-template-columns: 1fr;
  }
  .scheda {
    max-width: 100%;
  }
}

/* ============================================
   STILE SCHEDA (CARD FILM)
============================================ */
.scheda {
    width: 100%;
    aspect-ratio: 2/3;
    max-width: 280px;
    min-width: 0;
    margin: 0 auto;
    position: relative;
    height: auto;
    display: block;
    cursor: pointer;
}

/* Effetto hover sulla scheda */
.scheda:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    filter: grayscale(0%);
    cursor: pointer;
}

/* ============================================
   STILE POSTER STRAPPATO
============================================ */
.torn-poster {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* ============================================
   EXPAND ICON STYLING
============================================ */
.expand-icon {
    position: absolute;
    top: 14.8px;
    left: 14.8px;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 37.8px;
    height: 37.8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 1; /* Changed from 0 to 1 for testing */
    transform: scale(0.8);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}

.torn-poster:hover .expand-icon {
    opacity: 1;
    transform: scale(1);
}

.expand-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.expand-icon svg {
    transition: transform 0.3s ease;
}

.expand-icon:hover svg {
    transform: rotate(90deg);
}

/* ============================================
   EXPANDED FILM POSTER MODAL
============================================ */
.film-expanded-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.film-expanded-modal.show {
    opacity: 1;
}

.film-expanded-content {
    position: relative;
    aspect-ratio: 9/16;
    width: 90vw;
    max-width: 600px;
    height: auto;
    max-height: 90vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    display: block;
    /* margin: auto; <-- removed, let flexbox center it */
}

.film-expanded-modal.show .film-expanded-content {
    transform: scale(1);
}

.film-expanded-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    /* Make sure the image does not cover the close button */
    z-index: 1;
    position: relative;
}

.film-expanded-info {
    padding: 2rem;
    background: #f8f8f8;
}

.film-expanded-info h2 {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.film-expanded-details {
    margin-bottom: 1.5rem;
}

.film-expanded-details p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #666;
}

.film-expanded-details strong {
    color: #333;
}

.film-expanded-trailer {
    text-align: center;
}

.film-expanded-trailer a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--pink-main);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.film-expanded-trailer a:hover {
    background: #e6395c;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.3);
}

.film-expanded-trailer img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* Ensure close button is always over the image, in the top right corner */
.close-expanded-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.close-expanded-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8);
}

/* Responsive design for expanded modal */
@media (max-width: 900px) {
    .film-expanded-content {
        width: 95vw;
        max-width: 500px;
        max-height: 90vh;
    }
    

    
    .film-expanded-info {
        padding: 1.5rem;
    }
    
    .film-expanded-info h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .film-expanded-content {
        width: 100vw;
        max-width: 400px;
        max-height: 90vh;
        border-radius: 8px;
    }
    

    
    .film-expanded-info {
        padding: 1rem;
    }
    
    .film-expanded-info h2 {
        font-size: 1.3rem;
    }
    
    .film-expanded-details p {
        font-size: 0.9rem;
    }
}

.poster-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.poster-base {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-texture {
    display: none !important;
}



.torn-info-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    background-image: linear-gradient(to bottom, rgba(30,30,30,0.9), rgba(20,20,20,0.8)), url('https://www.transparenttextures.com/patterns/paper.png');
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
    color: #f5f5f5;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.torn-poster.active .poster-container {
    transform: translateY(-100%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.torn-poster.active .torn-info-container {
    transform: translateY(0);
}

.torn-info-container p {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #f5f5f5;
}

.torn-info-container p strong {
    margin-bottom: 0.1rem;
    display: block;
}

.torn-info-container p:not(:has(strong)) {
    margin-bottom: 1rem;
    margin-left: 0.5rem;
}

.torn-info-container a {
    color: var(--blue-main);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.torn-info-container a:hover {
    opacity: 0.8;
    color: var(--blue-light);
}

.audio-preview {
    margin-top: 1rem;
}

.audio-preview audio {
    width: 100%;
    height: 30px;
}

/* Override per hover sulla scheda con poster strappato */
.torn-poster:hover .poster-base {
    transform: scale(1.05);
}

/* ============================================
   STILE POSTER FILM
============================================ */
.poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.scheda:hover .poster {
    transform: scale(1.05);
}

/* ============================================
   INFORMAZIONI SCHEDA
============================================ */
.scheda-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.scheda:hover .scheda-info {
    transform: translateY(0);
    opacity: 1;
}

.scheda-titolo {
    font-family: var(--heading-font);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.scheda-titolo .year {
    font-weight: 400;
    font-family: var(--body-font);
}

.scheda-dettagli {
    font-family: var(--body-font);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
}

/* ============================================
   GESTIONE PAGINE
============================================ */
.page {
    display: none; /* Tutte le pagine sono nascoste di default */
}

.page.active {
    display: block; /* Solo la pagina attiva viene mostrata */
}

/* ============================================
   STILE FOOTER
============================================ */
.site-footer {
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    background: inherit;
    z-index: 100;
    /* Remove fixed positioning so it appears after all content */
    position: static;
    /* Remove left, right, bottom */
} 

.contact-footer {
    margin-top: 1.2rem;
    margin-bottom: 2.2rem;
    padding-bottom: 0.2rem;
    padding-top: 0;
    border-bottom: none;
}

.contact-footer a {
    font-family: var(--heading-font);
    font-size: 1.1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
    display: inline-block;
}

.contact-footer a:hover {
    color: var(--accent-color);
}

.copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.copyright a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright a:hover {
    color: var(--accent-color);
}

/* ============================================
   BIO PAGE STYLING
============================================ */
.bio-container {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    margin: 3rem auto 3rem auto !important;
    max-width: 1800px;
    padding-left: 2rem;
    padding-right: 2rem;
    margin-bottom: 5rem !important;
    margin-right: 2rem !important;
    border: none !important;
}

.bio-photo-container {
    flex: 0 0 300px;
}

.bio-photo {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 12px;
    filter: grayscale(50%);
    transition: filter 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.bio-photo:hover {
    filter: grayscale(0%);
}

.bio-text-container {
    flex: 1;
    /* No margin or padding on left/right, spacing is handled by .bio-container */
}

.bio-text {
    line-height: 1.7;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: calc(1em + 0.05rem);
}

.bio-text-container h2 {
    margin-bottom: 0.7rem;
}

.bio-links {
    display: flex;
    gap: 0.7rem;
    margin-top: 2rem;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.bio-button {
    padding: 0.6rem 1.2rem;
    background-color: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.bio-button:hover {
    background-color: rgba(255, 152, 255, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

.bio-button img {
    height: 20px;
    width: auto;
}

@media (max-width: 600px) {
  .bio-links {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .bio-links .bio-button {
    flex: 0 0 auto;
  }
  /* Place BNC Studio Facility (last item) on its own line */
  .bio-links .bio-button:last-child {
    flex-basis: 100%;
    justify-content: center;
  }
}

/* Mobile: hide UFO and Alien buttons */
@media (max-width: 600px) {
  .ufo-button,
  .alien-button {
    display: none !important;
  }
}

/* Mobile: center ASCII iframe in About */
@media (max-width: 600px) {
  .ascii-iframe {
    margin-top: 1.6rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
  }
}

/* ============================================
   STILE FORM CONTATTO
============================================ */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 5rem 0;
}

.contact-intro {
    margin-bottom: 0.7em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    font-size: 1.15rem;
}

.contact-container h2 {
    font-weight: 400;
    font-size: 1.4rem;
}

.contact-intro a {
    color: var(--blue-main);
    font-weight: normal;
    text-decoration: underline;
    transition: color 0.2s;
}

.contact-intro a:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 1.5rem;
}

.contact-input {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 152, 255, 0.15);
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: 1.15rem;
    transition: background-color 0.3s ease;
}

.contact-input:focus {
    outline: none;
    background-color: rgba(255, 152, 255, 0.25);
}

textarea.contact-input {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
  padding: 0.7rem 1.5rem;
  background: rgba(30,30,46,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  color: #fff;
  font-family: var(--body-font);
  font-size: 1.15rem;
  cursor: pointer;
  transition: border-color 0.35s cubic-bezier(0.4,0,0.2,1), border-width 0.35s cubic-bezier(0.4,0,0.2,1), background 0.3s cubic-bezier(0.4,0,0.2,1), transform 0.2s cubic-bezier(0.4,0,0.2,1);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  box-shadow: 0 4px 24px 0 rgba(50,132,201,0.13);
}
.submit-btn:hover {
  border-color: var(--blue-main);
  border-width: 1.5px;
  background: rgba(30,30,46,0.98);
  transform: translateY(-3px) scale(1.03);
}

/* ============================================
   ALIEN BUTTON
============================================ */
.alien-button {
    position: fixed;
    right: 35px;
    bottom: 38px;

    
    z-index: 100;
    font-size: 1.6rem;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
    user-select: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 12px var(--pink-main));
}
.alien-button:hover {
    filter: drop-shadow(0 0 22px var(--pink-main)) brightness(1.15);
    transform: scale(1.08);
}

@keyframes alien-slide {
  0%   { transform: translateX(-5px) scale(1); }
  20%  { transform: translateX(-2px) scale(1.03); }
  50%  { transform: translateX(5px) scale(1.02); }
  80%  { transform: translateX(2px) scale(0.98); }
  100% { transform: translateX(-5px) scale(1); }
}

.alien-button:hover {
  animation: alien-slide 0.8s linear infinite;
}

/* ============================================
   UPLOAD PAGE STYLING
============================================ */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.upload-intro {
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

#password-form-container {
    text-align: center;
    max-width: 300px;
    margin: 3rem auto 0 auto;
    margin-top: 6rem !important;
}

#upload-content {
    text-align: left;
    margin-top: 2rem;
}

/* Upload Sections */
.upload-section {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-section h4 {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

/* Category Selector */
.category-selector {
    text-align: center;
    margin-bottom: 1rem;
}

.category-dropdown {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 152, 255, 0.15);
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.category-dropdown:focus {
    outline: none;
    background-color: rgba(255, 152, 255, 0.25);
    border: 1px solid var(--accent-color);
}

.category-dropdown option {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Upload Forms */
.upload-form {
    margin-top: 2rem;
}

.project-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--body-font);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* File Input Styling */
.file-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px dashed rgba(255, 152, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(255, 152, 255, 0.05);
    color: var(--text-color);
    font-family: var(--body-font);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: var(--accent-color);
    background-color: rgba(255, 152, 255, 0.1);
}

.file-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 152, 255, 0.15);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.reset-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 2rem;
    border-radius: 6px;
    font-family: var(--body-font);
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Logout Section */
.logout-section {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 2rem;
    border-radius: 6px;
    font-family: var(--body-font);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 152, 255, 0.2);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Responsive Design for Upload Page */
@media (max-width: 768px) {
    .upload-container {
        padding: 1rem;
    }
    
    .upload-section {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .form-actions button {
        width: 100%;
        max-width: 300px;
    }
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .scheda-titolo {
        font-size: 1rem;
    }
    
    .scheda-dettagli {
        font-size: 0.7rem;
    }
    
    .web-area {
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 0.8rem;
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .bio-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .bio-photo-container {
        flex: 0 0 auto;
        max-width: 250px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .nav-menu {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 0.3rem;
    }
    
    .nav-menu a {
        padding: 0.4rem 0.3rem;
    }
}

@media (max-width: 400px) {
    .nav-menu {
        gap: 0.2rem;
    }
    
    .nav-menu a {
        padding: 0.3rem 0.2rem;
    }
}

/* ============================================
   GRIGLIA LIBRARIES (SCHEDE QUADRATE 1:1) - RIDOTTE A 2/3
============================================ */
.libraries-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.library-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    max-width: 320px;
    min-width: 320px;
    min-height: 320px;
    max-height: 320px;
    margin: 0 1rem 2rem 1rem;
}

.library-card .poster-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 320px;
    min-height: 320px;
    max-width: 320px;
    max-height: 320px;
}

.library-card .poster-base {
    width: 100%;
    height: 100%;
    min-width: 320px;
    min-height: 320px;
    max-width: 320px;
    max-height: 320px;
    object-fit: cover;
    display: block;
}

.library-card:hover .poster-base {
    transform: scale(1.1);
}

.library-card .torn-info-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    padding: 1.5rem 1rem 1rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 120px;
}

.library-card:hover .torn-info-container {
    transform: translateY(-18px);
}

.library-card .scheda-titolo {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.library-card .torn-info-container p {
    margin: 0.4rem 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Player audio classico in basso */
.library-card .classic-audio-player {
    width: 100%;
    margin-top: 1.2rem;
    margin-bottom: 0.2rem;
    align-self: flex-end;
}
.library-card .classic-audio-player audio {
    width: 100%;
    height: 32px;
    background: #222;
    border-radius: 6px;
}

/* ============================================
   PLAYER AUDIO CIRCOLARE - RIDOTTO
============================================ */
.circular-player {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0 0.5rem;
}

.player-circle {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-circle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.player-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.player-button:hover {
    background: white;
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    color: #333;
    font-size: 0.9rem;
    margin-left: 1px;
    transition: all 0.3s ease;
}

.player-circle.playing .play-icon {
    transform: scale(0.8);
}

.player-circle.playing .play-icon::before {
    content: "⏸";
}

.player-progress {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top: 2px solid #ffe066;
    transform: rotate(-90deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-circle.playing .player-progress {
    opacity: 1;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(-90deg);
    }
    to {
        transform: rotate(270deg);
    }
}

/* ============================================
   PAGINA COMMERCIAL - LAYOUT COMPATTO CON POSTER VERTICALI
============================================ */
.commercial-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.commercial-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    margin-top: 0rem;
    margin-bottom: -1.5rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.commercial-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 0 5rem;
}

.commercial-card:hover {
    transform: translateX(16px);
}

.poster-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 260px;
}

.poster-img {
    width: 260px;
    height: 370px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    background: #181818;
    margin-bottom: 1.2rem;
    position: relative;
}

.poster-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #181818;
    color: #fff;
    font-size: 1.6rem;
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 2;
}

.play-btn:hover {
    background: #00b894;
    color: #fff;
    transform: scale(1.08);
}

.info-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.project-info {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-width: 260px;
    max-width: 400px;
    color: #fff;
}

.project-title {
  font-size: 1rem !important;
  letter-spacing: 0.1em;
  margin-bottom: 0.7rem;
}

.project-details p {
    margin: 0.5rem 0;
    font-size: 1.05rem;
    color: #e0e0e0;
}

.project-details strong {
  color: var(--blue-main);
  min-width: 90px;
  font-weight: 600;
}

@media (max-width: 1024px) {
    .commercial-card {
        gap: 1.5rem;
    }
    .poster-img {
        width: 180px;
        height: 260px;
    }
    .project-info {
        padding: 1.2rem 1.2rem 1rem 1.2rem;
        min-width: 180px;
        max-width: 90vw;
    }
}

@media (max-width: 768px) {
    .commercial-card {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
        margin-bottom: 0rem;
    }
    .poster-col {
        min-width: 0;
        width: 100%;
    }
    .poster-img {
        width: 90vw;
        max-width: 400px;
        height: 220px;
        margin-bottom: 0.8rem;
    }
    .play-btn {
        margin-bottom: 1.2rem;
    }
    .info-col {
        width: 100%;
        justify-content: center;
    }
    .project-info {
        width: 90vw;
        max-width: 400px;
        min-width: 0;
        padding: 1.2rem 1.2rem 1rem 1.2rem;
    }
    .play-btn {
        right: 12px;
        bottom: 12px;
    }
}

/* Info card invisibile */
.vertical-info {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: 320px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: #fff;
}

/* Poster orizzontale più grande */
.horizontal-poster {
    width: 410px;
    height: 230px;
}

/* Sfasatura tra progetti pari/dispari */
.offset-card {
    margin-top: 0;
}

@media (max-width: 768px) {
    .horizontal-poster {
        width: 90vw;
        height: 160px;
    }
    .offset-card {
        margin-top: 0;
    }
    .vertical-info {
        width: 90vw;
        min-height: 0;
        max-width: 100%;
    }
}

.trailer-link-bottom-right {
    position: absolute;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 2;
}

.trailer-link-bottom-right a {
  color: var(--pink-main);
  font-weight: 600;
  text-decoration: underline;
  font-size: 1.08rem;
  transition: color 0.2s;
}
.trailer-link-bottom-right a:hover {
  color: #fff;
}

/* Trailer button always blue, underline on hover */
.trailer-link-bottom-right a span {
  color: #0074D9 !important;
  text-decoration: none;
  font-weight: 400;
}
.trailer-link-bottom-right a:hover span {
  text-decoration: underline;
}

.ufo-button {
    position: fixed;
    left: 30px;
    bottom: 30px;
    z-index: 100;
    font-size: 2.2rem;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
    user-select: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 12px var(--pink-main));
}
.ufo-button:hover {
    filter: drop-shadow(0 0 16px var(--pink-main)) brightness(1.15);
    transform: scale(1.08);
}

@keyframes ufo-hover {
  0%   { transform: translate(0, 0) scale(1); }
  20%  { transform: translate(2px, -3px) scale(1.03); }
  40%  { transform: translate(-2px, 2px) scale(0.98); }
  60%  { transform: translate(3px, 1px) scale(1.02); }
  80%  { transform: translate(-2px, -2px) scale(1.01); }
  100% { transform: translate(0, 0) scale(1); }
}

.ufo-button:hover {
  animation: ufo-hover 0.8s infinite linear;
}

/* ============================================
   WAVETABLE PAGE STYLING
============================================ */
.wavetable-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    padding: 0;
    margin-top: 4rem;
}

.wave-container {
    position: relative;
    width: 600px;
    height: 300px;
    border: 1px solid rgba(92, 187, 246, 0.2);
    overflow: hidden;
    background-color: transparent;
    cursor: none;
}

.wave-node {
    position: absolute;
    width: 1em;
    height: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(92, 187, 246, 0.7);
    font-size: 12px;
    transition: color 0.1s ease;
    user-select: none;
    z-index: 1;
}

.wave-node.active-1 { 
    color: rgba(255, 95, 86, 0.9); 
}

.wave-node.active-2 { 
    color: rgba(162, 119, 255, 0.9); 
}

.wave-node.active-3 { 
    color: rgba(98, 232, 132, 0.9); 
}

.mouse-cursor {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 95, 86, 0.7);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 0 10px rgba(255, 95, 86, 0.5);
}

.service-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    z-index: 2;
}

.service-cell {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-label {
    color: rgba(255, 255, 255, 0);
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 3px;
    opacity: 0;
    text-shadow: 0 0 5px rgba(255, 95, 86, 0);
    letter-spacing: 1px;
    pointer-events: none;
}

.service-cell:hover .service-label {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(24, 24, 37, 0.7);
    opacity: 1;
    text-shadow: 0 0 5px rgba(255, 95, 86, 0.5);
} 



.empty-scheda {
  aspect-ratio: 2/3;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 10px, transparent 10px 20px);
  border: 2px dashed rgba(255,255,255,0.15);
  box-sizing: border-box;
} 

/* LIBRARIES PAGE RESTYLE */
.library-full-poster {
  position: relative;
  width: 100%;
  max-width: 576px;
  aspect-ratio: 16/9;
  margin: 2rem auto 2.5rem auto;
  border-radius: 0 !important;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  background: #222;
  display: flex;
  align-items: flex-end;
}
.library-full-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.library-full-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 80%);
  color: #fff;
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.library-full-overlay h2 {
  font-size: 1.2rem;
  font-family: var(--heading-font);
  margin-bottom: 0.7rem;
}
.library-full-overlay div {
  font-size: 1.1rem;
  margin-bottom: 0;
}
.library-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  justify-content: start;
  align-content: start;
  margin-top: 5rem;
  margin-bottom: 2rem;
  padding-bottom: 4.5rem;
  /* grid-auto-flow: row; // default, ensures left-to-right, top-to-bottom fill */
}
@media (max-width: 900px) {
  .library-mini-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding-bottom: 4.5rem;
  }
}
@media (max-width: 600px) {
  .library-mini-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding-bottom: 6.5rem;
  }
}
.library-mini-poster {
  position: relative;
  /* Set width to 100% of grid cell, height to 2/3 of grid cell (aspect ratio 2:3) */
  width: 100%;
  aspect-ratio: 2/3;
  height: 66.666%; /* 2/3 of the grid cell height */
  max-width: 180px;
  max-height: 240px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  cursor: pointer;
  background: #222;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .library-mini-poster {
    max-width: 120px;
    max-height: 180px;
  }
}
@media (max-width: 600px) {
  .library-mini-poster {
    max-width: 90px;
    max-height: 135px;
  }
}
.library-mini-poster:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.library-mini-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.library-mini-title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 80%);
  color: #fff;
  font-family: var(--heading-font);
  font-size: 1.1rem;
  padding: 0.7rem 1rem 1.2rem 1rem;
  text-align: left;
  box-sizing: border-box;
}
#cropper-modal {
  display: flex;
}
#cropper-modal[style*='display:none'] {
  display: none !important;
}
@media (max-width: 900px) {
  .library-full-poster { max-width: 94vw; }
  .library-mini-grid { gap: 1rem; }
  .library-mini-poster { width: 120px; height: 120px; }
  .library-full-overlay { padding: 1rem 1rem 1rem 1rem; }
}
@media (max-width: 600px) {
  .library-full-poster { max-width: 100vw; }
  .library-mini-grid { flex-wrap: wrap; gap: 0.7rem; }
  .library-mini-poster { width: 90px; height: 90px; }
  .library-full-overlay h2 { font-size: 1.2rem; }
  .library-full-overlay div { font-size: 0.9rem; }
} 

#library-full-poster-container {
  transition: opacity 0.5s cubic-bezier(0.4,0,0.2,1), visibility 0.5s;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}
#library-full-poster-container.show {
  opacity: 1;
  visibility: visible;
}
#library-full-poster-container.hide {
  opacity: 0;
  visibility: hidden;
} 

.custom-audio-player {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: transparent;
  border: 2px solid transparent;
  box-shadow: none;
  padding: 0.4rem 1.6rem 0.4rem 1.2rem;
  margin-top: 1.8rem;
  margin-bottom: 1rem;
  width: 100%;
  min-width: 340px;
  max-width: 100%;
  min-height: 2.6rem;
  opacity: 0.96;
  transition: border-color 0.2s, background 0.2s;
  overflow: visible;
  box-sizing: border-box;
}
.custom-audio-player .audio-player-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: 2.4rem;
}
.custom-audio-player button {
  background: none;
  border: none;
  color: var(--pink-main);
  font-size: 1.5rem;
  cursor: pointer;
  outline: none;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.custom-audio-player button:hover {
  color: #fff;
}
.custom-audio-player .audio-seek {
  flex: 4 1 0%;
  height: 4px;
  background: rgba(0, 102, 255, 0.5); /* blue with 50% transparency */
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  margin: 0 0.7rem;
  min-width: 260px;
  max-width: 100%;
  margin-left: -2.5rem;
  margin-right: 0.7rem;
}
.custom-audio-player .audio-seek-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--pink-main);
  border-radius: 2px;
  height: 100%;
  width: 0%;
  pointer-events: none;
  transition: width 0.1s linear;
}
.custom-audio-player .audio-time {
  font-family: var(--body-font);
  font-size: 1.1rem;
  color: #fff;
  min-width: 70px;
  text-align: right;
  margin: 0;
  display: flex;
  align-items: center;
  height: 1.2rem;
}
.custom-audio-player .audio-volume {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  height: 1.6rem;
  position: relative;
  margin-left: 0.5rem;
}
.custom-audio-player .audio-volume input[type=range] {
  position: absolute;
  left: 50%;
  bottom: 1.8rem;
  transform: translateX(-50%) rotate(-90deg);
  width: 70px;
  height: 1.2rem;
  accent-color: var(--pink-main);
  background: transparent;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2;
}
.custom-audio-player .audio-volume.show-slider input[type=range] {
  opacity: 1;
  pointer-events: auto;
}
.custom-audio-player .audio-volume-icon {
  font-size: 1.1rem;
  width: 1.2rem;
  height: 1.2rem;
  min-width: 1.2rem;
  min-height: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-main);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 3;
  flex-shrink: 0;
  vertical-align: middle;
  /* Center icon with text */
  position: relative;
  top: 50%;
  transform: translateY(-0.75rem);
}
.custom-audio-player .audio-volume-svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}
.custom-audio-player .audio-volume-icon:hover {
  color: #fff;
}

.library-mini-poster img,
.library-full-poster img {
  filter: grayscale(100%);
  transition: filter 0.4s cubic-bezier(0.4,0,0.2,1);
}
.library-mini-poster:hover img,
.library-mini-poster.active img {
  filter: grayscale(0%);
}
.library-full-poster img.color {
  filter: grayscale(0%);
} 

.poster-img img {
  filter: grayscale(100%);
  transition: filter 0.4s cubic-bezier(0.4,0,0.2,1);
}
.commercial-card:hover .poster-img img,
.commercial-card.active .poster-img img {
  filter: grayscale(0%);
} 

.bio-button#library-full-minimize {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
}

.library-audio-player {
  background: rgba(30,30,30,0.25);
  border: 2px solid var(--pink-main);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  padding: 0.3rem 0.7rem;
  margin-top: 2.5rem;
  width: 100%;
  opacity: 0.92;
  transition: background 0.2s, opacity 0.2s, border-color 0.2s;
}

.library-audio-player::-webkit-media-controls-panel {
  background: transparent;
  border-radius: 8px;
}

.library-audio-player:focus {
  outline: 2px solid var(--pink-main);
  border-color: var(--pink-main);
}

.library-audio-player:hover {
  border-color: var(--pink-main);
  opacity: 1;
} 

.custom-audio-player button.audio-play-btn {
  font-size: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  color: var(--pink-main);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  top: -0.025rem;
}
.custom-audio-player button.audio-play-btn:hover {
  color: #fff;
  background: transparent;
} 

.close-btn .close-round-svg .close-round-outline {
  transition: fill 0.2s, stroke 0.2s;
}
.close-btn .close-round-svg .close-round-x {
  transition: fill 0.2s;
}
.close-btn:hover .close-round-svg .close-round-outline {
  fill: var(--pink-main);
  stroke: #111;
  stroke-width: 8px;
}
.close-btn:hover .close-round-svg .close-round-x {
  fill: #111;
  stroke: var(--pink-main);
  stroke-width: 8px;
} 

/* Remove .audio-waveform styles */

/* ANIMATED FREQUENCY BARS AUDIO PLAYER */
.animated-audio-player {
  display: flex;
  align-items: center;
  gap: 0px;
  background: rgba(30,30,30,0.05);
  border: none;
  border-radius: 12px;
  padding: 0.6rem 1.2rem;
  margin-top: 1.8rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 700px;
  min-height: 75px;
  opacity: 0.95;
  transition: background 0.3s, opacity 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.animated-audio-player:hover {
  background: rgba(30,30,30,0.1);
  opacity: 1;
}

.animated-audio-player .audio-play-btn {
  background: none;
  border: none;
  color: var(--pink-main);
  cursor: pointer;
  outline: none;
  padding: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
  transform: translateY(0px);
  margin-right: -15px;
}

.animated-audio-player .audio-play-btn:hover {
  color: #fff;
  background: rgba(255, 77, 109, 0.1);
  transform: translateY(2px) scale(1.05);
}

.frequency-visualizer {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
  height: 55px;
  flex: 2;
  min-width: 400px;
  max-width: 450px;
  padding: 0;
  margin: 0 -20px 0 -20px;
  overflow: hidden;
  position: relative;
  transform: translateY(-22px);
}

.freq-bar {
  background: linear-gradient(
    180deg, 
    #fff 0%, 
    rgba(255, 255, 255, 0.9) 50%, 
    rgba(255, 255, 255, 0.7) 100%
  );
  width: 4px;
  height: 2%;
  min-height: 2px;
  border-radius: 1.5px;
  transition: height 0.1s ease-out;
  opacity: 0.9;
  position: relative;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.freq-bar:nth-child(odd) {
  background: linear-gradient(
    180deg, 
    #fff 0%, 
    rgba(255, 255, 255, 0.85) 50%, 
    rgba(255, 255, 255, 0.65) 100%
  );
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}

.freq-bar:hover {
  opacity: 1;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.8)) brightness(1.1);
}

.animated-audio-player .audio-time {
  font-family: var(--body-font);
  font-size: 1.1rem;
  color: #fff;
  min-width: 100px;
  text-align: right;
  margin: 0;
  margin-left: 0px;
  margin-right: -10px;
  display: flex;
  align-items: center;
  height: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  white-space: nowrap;
  transform: translateY(3px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .animated-audio-player {
    gap: 0px !important;
    padding: 0.5rem 0.8rem !important;
    max-width: 100% !important;
    min-height: 65px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  
  .frequency-visualizer {
    height: 45px;
    padding: 0;
    min-width: 180px;
    max-width: 200px;
    flex: 1;
    margin: 0 -15px 0 -15px;
  }
  
  .freq-bar {
    width: 4px;
    gap: 1.5px;
  }
  
  .animated-audio-player .audio-time {
    font-size: 0.85rem;
    width: 70px;
    margin-right: -12px;
    margin-left: -5px;
    white-space: normal;
    line-height: 1.1;
    text-align: center;
    flex-shrink: 0;
    flex-grow: 0;
  }
  
  .animated-audio-player .audio-play-btn {
    width: 38px;
    height: 38px;
    margin-right: -15px;
  }
  
  /* Library full poster mobile optimization */
  .library-full-poster {
    max-width: 95vw;
    max-height: 80vh;
  }
  
  .library-full-overlay {
    padding: 1rem;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8) 20%, rgba(0,0,0,0.95));
  }
  
  .library-full-overlay h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }
  
  .library-full-overlay div {
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
  }
}

@media (max-width: 480px) {
  .animated-audio-player {
    gap: 0px !important;
    padding: 0.4rem 0.6rem !important;
    min-height: 60px !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  
  .frequency-visualizer {
    height: 38px;
    padding: 0;
    min-width: 150px;
    max-width: 170px;
    flex: 1;
    margin: 0 -12px 0 -12px;
  }
  
  .freq-bar {
    width: 3px;
    gap: 1px;
  }
  
  .animated-audio-player .audio-time {
    font-size: 0.75rem;
    width: 60px;
    margin-right: -8px;
    margin-left: -4px;
    white-space: normal;
    line-height: 1.0;
    text-align: center;
    flex-shrink: 0;
    flex-grow: 0;
  }
  
  .animated-audio-player .audio-play-btn {
    width: 34px;
    height: 34px;
    margin-right: -12px;
  }
  
  /* Mobile library overlay optimizations */
  .library-full-poster {
    max-width: 98vw;
    max-height: 85vh;
  }
  
  .library-full-overlay {
    padding: 0.8rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85) 15%, rgba(0,0,0,0.98));
  }
  
  .library-full-overlay h2 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
  }
  
  .library-full-overlay div {
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
  }
  
  /* Touch-friendly close button */
  .close-btn {
    width: 44px;
    height: 44px;
    top: 10px;
    right: 10px;
  }
  
  /* Prevent horizontal scroll on mobile */
  #library-full-poster-container {
    padding: 0 5px;
  }
} 

.library-mini-poster,
.library-mini-poster img,
.library-full-poster img,
.poster-img,
.poster-img img,
.horizontal-poster,
.library-card .poster-container,
.library-card .poster-base {
  border-radius: 0 !important;
} 

.library-full-poster,
.library-full-poster img {
  border-radius: 0 !important;
} 

.project-title,
.library-full-overlay h2,
.library-mini-title {
  font-family: var(--heading-font);
  font-weight: 400;
} 

.library-full-overlay h2,
.library-full-overlay div {
  text-shadow: 0 6px 24px rgba(0,0,0,0.75), 0 2px 4px rgba(0,0,0,0.65);
} 

.custom-audio-player button.audio-play-btn {
  margin-left: -1.8rem;
} 

.custom-audio-player button.audio-play-btn {
  font-size: 1.5rem;
} 

.custom-audio-player .audio-play-svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
  margin: 0 auto;
} 

.libraries-intro-text {
  color: #fff;
  text-align: center;
  font-size: 1.15rem;
  margin: 3rem 0 2.2rem 0 !important;
  font-family: var(--body-font, Arial, sans-serif);
}
.libraries-intro-text .pink-link {
  color: var(--pink-main);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}
.libraries-intro-text .pink-link:hover {
  color: #fff;
  background: var(--pink-main);
  border-radius: 4px;
  text-decoration: none;
} 

/* FINAL OVERRIDE: FORCE SHARP CORNERS ON ALL POSTERS */
.scheda,
.torn-poster,
.poster-container,
.poster-base,
.poster,
.scheda img,
.poster-img,
.poster-img img,
.library-card .poster-container,
.library-card .poster-base,
.library-mini-poster,
.library-mini-poster img,
.library-full-poster,
.library-full-poster img,
.horizontal-poster,
.empty-scheda {
  border-radius: 0 !important;
} 

.site-footer {
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    background: inherit;
    z-index: 100;
    /* Remove fixed positioning so it appears after all content */
    position: static;
    /* Remove left, right, bottom */
} 

.copyright-fixed {
  position: static;
  left: unset;
  right: unset;
  bottom: unset;
  z-index: unset;
  text-align: center;
  background: inherit;
} 

/* Smaller submit buttons for CAMBIA INFO SITO mini-forms */
.upload-section .submit-btn {
  padding: 0.3rem 1.1rem;
  font-size: 0.85rem;
  border-radius: 8px;
  min-width: 80px;
  box-shadow: none;
  margin-top: 0.3rem;
} 

/* Strong shadow for trailer button in commercial schedas - now sharp corners and 50% transparent */
.commercial-card .trailer-link-bottom-right {
  box-shadow: 0 4px 18px 0 rgba(0, 60, 180, 0.25), 0 1.5px 6px 0 rgba(0, 60, 180, 0.18);
  border-radius: 0;
  background: rgba(255,255,255,0.5);
  padding: 0.18rem 0.7rem 0.18rem 0.5rem;
  display: inline-block;
} 

/* Strong text shadow for play icon and trailer text in commercial trailer button */ 

/* Make play icon and trailer text black in commercial trailer button */
.commercial-card .trailer-link-bottom-right img {
  filter: none !important;
}
.commercial-card .trailer-link-bottom-right span {
  color: #111 !important;
} 

/* WAVETABLE PAGE: Anchor footer to bottom (absolute, no flex) */
#wavetable-page {
  position: relative;
}
#wavetable-page .site-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin-top: 0;
  padding-bottom: 1.2rem;
  background: inherit;
}
#wavetable-page .copyright-fixed {
  position: static;
  left: unset;
  right: unset;
  bottom: unset;
  z-index: unset;
  text-align: center;
  background: inherit;
} 

/* GLOBAL: Fixed transparent footer container for all pages */
.global-footer-container {
  position: static;
  left: unset;
  right: unset;
  bottom: unset;
  width: 100%;
  background: transparent;
  display: block;
  pointer-events: none;
  z-index: 1000;
  min-height: 0;
}
.global-footer-container .site-footer {
  pointer-events: auto;
  background: rgba(0,0,0,0.0);
  margin-bottom: 0;
  border: none;
  box-shadow: none;
  text-align: center;
  max-width: 100%;
}
@media (max-width: 600px) {
  .global-footer-container {
    bottom: 1rem;
  }
} 

.footer-spacer {
  width: 100%;
  height: 7rem;
  pointer-events: none;
  background: transparent;
}
@media (max-width: 600px) {
  .footer-spacer {
    height: 9rem;
  }
} 

.logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 16px;
    padding: 0.6rem 1.4rem 0.6rem 1rem;
    margin-right: 1.4rem;
    vertical-align: middle;
    box-shadow: none;
    border: none;
}
.main-logo {
    height: 4.2rem; /* double height */
    width: auto;
    display: block;
    filter: invert(62%) sepia(80%) saturate(7476%) hue-rotate(285deg) brightness(101%) contrast(101%); /* pink filter */
}
header h1 {
    display: inline-block;
    vertical-align: middle;
} 

.main-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    margin-bottom: 0.2rem;
}
.main-t1, .main-t2 {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    color: var(--blue-main);
    letter-spacing: 0.08em;
    font-weight: 400;
    line-height: 1.1;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .main-title-row {
        flex-direction: column;
        gap: 0.7rem;
    }
    .main-t1, .main-t2 {
        font-size: 1.5rem;
    }
    .logo-box {
        padding: 0.3rem 0.7rem 0.3rem 0.5rem;
        margin-right: 0.7rem;
        border-radius: 10px;
    }
    .main-logo {
        height: 2.1rem;
    }
} 

.main-t1, .main-t2 {
    font-size: 1.5rem !important;
}
.logo-box {
    padding: 0.78rem 0.2rem 0.78rem 0.2rem !important;
    margin-right: 0.88rem !important;
    border-radius: 4px !important;
}
.main-logo {
    height: 1.6rem !important;
    filter: brightness(0) saturate(100%) invert(36%) sepia(77%) saturate(7476%) hue-rotate(185deg) brightness(101%) contrast(101%) !important;
}
@media (max-width: 600px) {
    .main-t1, .main-t2 {
        font-size: 1.2rem !important;
    }
    .main-logo {
        height: 1.2rem !important;
    }
    .logo-box {
        padding: 0.74rem 0.1rem 0.74rem 0.1rem !important;
        margin-right: 0.79rem !important;
        border-radius: 2px !important;
    }
} 

/* MOBILE: Crop main header logo from the right to fit mobile window */
@media (max-width: 600px) {
  #logo-box-flex {
    width: 100% !important;
    max-width: 100% !important;
    height: 95px !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  /* Pull logo slightly left on mobile */
  #logo-box-flex { margin-left: -8px !important; }
  #main-logo-img {
    width: 100% !important;
    height: 95px !important;
    object-fit: cover !important;
    object-position: left center !important;
    display: block;
    max-width: none !important;
  }
  header {
    overflow: hidden !important;
    width: 100% !important;
  }
  html, body, .web-area {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .web-area {
    box-sizing: border-box !important;
  }
}

/* Mobile: center film and documentary posters vertically within viewport */
@media (max-width: 600px) {
  .film-mini-grid,
  .documentary-mini-grid {
    justify-content: center !important;
    min-height: calc(100vh - 230px) !important;
  }
}

/* FILM INFO MODAL (CARD SIZE) */
.film-info-modal {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.film-info-modal.show {
  opacity: 1;
  pointer-events: auto;
}
.film-info-content {
  background: #1a1a1a;
  background-image: linear-gradient(to bottom, rgba(30,30,30,0.95), rgba(20,20,20,0.92)), url('https://www.transparenttextures.com/patterns/paper.png');
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  padding: 1.2rem 1.2rem;
  min-width: 370px;
  min-height: 246px;
  max-width: 90vw;
  max-height: auto;
  width: 370px;
  height: 246px;
  aspect-ratio: 3/2;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.35s cubic-bezier(0.16,1,0.3,1);
  margin-top: -150px;
  font-size: 0.7rem;
}

/* Responsive margin for different viewport heights */
@media (max-height: 600px) {
  .film-info-content {
    margin-top: -100px;
  }
}

@media (max-height: 500px) {
  .film-info-content {
    margin-top: -50px;
  }
}

@media (max-height: 400px) {
  .film-info-content {
    margin-top: -20px;
  }
}

@media (max-height: 300px) {
  .film-info-content {
    margin-top: 0px;
  }
}
@media (max-width: 700px) {
  .film-info-content {
    min-width: 90vw;
    max-width: 98vw;
    min-height: 0;
    width: 90vw;
    height: auto;
    aspect-ratio: 3/2;
    padding: 1.2rem 0.5rem 1.2rem 0.5rem;
  }
}
.film-info-modal.show .film-info-content {
  transform: scale(1);
  opacity: 1;
}
.close-info-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s;
}
.close-info-btn:hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.08);
}
.film-info-details {
  color: #f5f5f5;
  font-family: var(--body-font);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: 0.3rem;
}
.film-info-meta {
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.film-info-details h3 {
  font-size: 1rem;
  text-align: center;
  margin-top: -0.5rem;
}
.film-info-details .year-type {
  font-size: 1rem;
  color: #bbb;
  text-align: center;
  margin-bottom: 0.2rem;
}
.film-info-details .year-type .type {
  color: #888;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.film-info-details p {
  font-size: 0.85rem;
}
.film-info-details strong {
  color: inherit;
  font-weight: 600;
}
.film-info-details .info-actions {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 2.2rem;
  width: 100%;
  position: absolute;
  left: 0;
  bottom: 1.5rem;
  padding: 0 2.2rem;
  box-sizing: border-box;
}
.film-info-details .imdb-btn {
  font-weight: bold;
  color: #F5C518;
  font-size: 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  margin: 0;
}
.film-info-details .imdb-btn:hover {
  text-decoration: underline;
}
.film-info-details .trailer-link {
  font-size: 1rem;
  color: var(--blue-main);
  text-decoration: none;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  justify-content: flex-end;
}
.film-info-details .trailer-link:hover {
  color: var(--blue-light);
  text-decoration: underline;
}

/* Disabled button styles */
.film-info-details .imdb-btn.disabled,
.film-info-details .trailer-link.disabled,
.film-info-actions-group .imdb-btn.disabled,
.film-info-actions-group .trailer-link.disabled,
.mobile-poster-flip .imdb-btn.disabled,
.mobile-poster-flip .trailer-link.disabled,
.trailer-link-bottom-right a.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  color: #888 !important;
}

.film-info-details .imdb-btn.disabled:hover,
.film-info-details .trailer-link.disabled:hover,
.film-info-actions-group .imdb-btn.disabled:hover,
.film-info-actions-group .trailer-link.disabled:hover,
.mobile-poster-flip .imdb-btn.disabled:hover,
.mobile-poster-flip .trailer-link.disabled:hover,
.trailer-link-bottom-right a.disabled:hover {
  color: #888 !important;
  text-decoration: none;
} 

@media (max-width: 700px) {
  .film-info-content {
    min-width: 90vw;
    max-width: 98vw;
    padding: 1.2rem 0.5rem 1.2rem 0.5rem;
  }
  .film-info-details .info-actions {
    padding: 0 0.5rem;
    left: 0;
    right: 0;
  }
}

.film-info-meta {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.film-info-meta strong {
  color: #bbb;
  font-weight: 400;
}

.film-info-details .imdb-btn,
.film-info-details .trailer-link {
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
}
.film-info-details .trailer-link svg {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.55));
}

.poster-base.rotate-out {
  transform: rotateY(90deg) scale(0.9);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4,1,0.3,1), opacity 0.28s cubic-bezier(0.4,1,0.3,1);
}

.links-box {
  margin-top: 1.2rem;
  border: none !important;
}

/* === FLIP CARD EFFECT FOR FILM&TV === */
.flip-container {
  perspective: 1200px;
  width: 100%;
  height: 100%;
}
.flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4,0.2,0.2,1);
  transform-style: preserve-3d;
}
.flipped .flipper {
  transform: rotateY(180deg);
}
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
}
.card-front {
  z-index: 2;
}
.card-back {
  background: #181818;
  color: #fff;
  transform: rotateY(180deg);
  z-index: 3;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
}
.card-back .film-info-details {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    gap: 0;
    /* Enable scrolling if content overlaps the fixed buttons */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
.film-info-title-group {
    margin-bottom: 0.3rem;
    margin-top: 0rem;
    margin-left:  -0.5rem;
    margin-right: 0;
    padding-top: 0.5rem;
    padding-bottom: 0.2rem;
    padding-left: 0;
    padding-right: 0;
    width: 98%;
    height: calc(100% + 0.5rem);
    position: relative;
    top: -1.8rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.film-info-title-group .year-type {
    display: inline-block;
    white-space: nowrap;
    width: auto;
    margin: 0;
    padding: 0;
}
.film-info-meta-group {
  margin: -1.2rem 0 1.5rem 0;
  padding: 0.2rem 0.2rem 0.2rem 0.2rem;
  position: relative;
  top: -0.8rem;
}
.film-info-meta-group p {
  line-height: 1.4rem;
  font-size: 1rem;
}
.film-info-meta-group p strong {
  font-weight: 500;
  color: var(--blue-main);
}
.film-info-actions-group {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: rgba(24,24,24,0.98);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.18);
  margin: 0 !important;
  padding: 1.2rem 2.2rem !important;
  width: 100vw;
  max-width: 600px;
  /* Center horizontally in viewport */
  margin-left: auto;
  margin-right: auto;
}
.film-info-actions-group .imdb-btn {
  margin-left: 0;
  margin-right: auto;
  font-size: 1rem;
}
.film-info-actions-group .trailer-link {
  margin-left: auto;
  margin-right: 0;
  font-size: 1rem;
}
.card-back .close-info-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--pink-main);
  font-size: 1.7rem;
  cursor: pointer;
  z-index: 10;
}
.card-back .close-info-btn:hover {
  color: var(--blue-main);
}

.card-back .film-info-details h3 {
  margin-top: 0.3rem;
  margin-bottom: 0.2rem;
}
.card-back .film-info-details .year-type {
  margin-top: 0.1rem;
  margin-bottom: 0.7rem;
}

/* Move title and year/type higher */
.card-back .film-info-details {
  padding-top: 0.3rem;
}
.card-back .film-info-details h3 {
  margin-top: 0;
  margin-bottom: 0.1rem;
}
.card-back .film-info-details .year-type {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* Remove soft corners for sharp poster edges */
.scheda,
.card-front,
.card-back {
  border-radius: 0 !important;
}

/* Always black and white posters, no color on hover */
.scheda .poster-base {
  filter: grayscale(100%);
  transition: none !important;
}
.scheda:hover .poster-base {
  filter: grayscale(100%);
}

/* Add good margins and spacing to the film info card and its groups */
.film-info-details {
  margin: 1.6rem 1.6rem 1.6rem 1.6rem !important;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem !important;
  border-radius: 14px;
  background: rgba(24,24,24,0.98);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

/* Responsive adjustments for zoom levels */
@media (min-resolution: 120dpi) {
  .film-info-meta-group {
    top: -1.2rem;
    margin: -1.5rem 0 3.5rem 0;
  }
  .film-info-title-group {
    top: -1.5rem;
    padding-top: 1.2rem;
    margin-top: 1.8rem;
  }
  .film-info-actions-group {
    margin-top: 4rem;
  }
}

@media (min-resolution: 144dpi) {
  .film-info-meta-group {
    top: -1.5rem;
    margin: -1.8rem 0 4rem 0;
  }
  .film-info-title-group {
    top: -2rem;
    padding-top: 0.6rem;
    margin-top: 1.8rem;
  }
  .film-info-actions-group {
    margin-top: 4.5rem;
  }
}

@media (min-resolution: 168dpi) {
  .film-info-meta-group {
    top: -2rem;
    margin: -2.2rem 0 4.5rem 0;
  }
  .film-info-title-group {
    top: -2.5rem;
    padding-top: 0.5rem;
    margin-top: 2rem;
  }
  .film-info-actions-group {
    margin-top: 5rem;
  }
}

/* Responsive adjustments for small windows */
@media (max-width: 600px) {
  .film-info-actions-group {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1.5rem;
  }
  .film-info-actions-group .imdb-btn,
  .film-info-actions-group .trailer-link {
    font-size: 0.9rem;
  }
}

@media (max-width: 400px) {
  .film-info-actions-group {
    margin-top: 1rem;
  }
  .film-info-actions-group .imdb-btn,
  .film-info-actions-group .trailer-link {
    font-size: 0.8rem;
  }
}
.card-back .film-info-details {
  margin: 1.2rem 1.2rem 1.2rem 1.2rem !important;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem !important;
}
.film-info-title-group {
  margin-bottom: 0.3rem;
  margin-top: 2rem;
  padding-top: 1rem;
  padding-bottom: 0.2rem;
}
.film-info-meta-group {
  margin: -1.2rem 0 1.5rem 0;
  padding: 0.2rem 0.2rem 0.2rem 0.2rem;
  position: relative;
  top: -0.8rem;
}
.film-info-actions-group {
  margin-top: 2rem;
  margin-left: 0;
  margin-right: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0;
}
.film-info-actions-group .imdb-btn {
  margin-left: 0;
  margin-right: auto;
  font-size: 1rem;
}
.film-info-actions-group .trailer-link {
  margin-left: auto;
  margin-right: 0;
  font-size: 1rem;
}

@media (max-width: 600px) {
  .mobile-poster-box {
    width: 100vw;
    max-width: 375px;
    min-width: 320px;
    aspect-ratio: 3/2;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto 1.2rem auto;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
  }
  .mobile-poster-sideband {
    flex: 1 1 0;
    height: 100%;
    background: rgba(var(--blue-main-rgb, 50, 132, 201), 0.15) !important;
    display: block;
  }
  .mobile-poster-img {
    height: 100%;
    width: auto;
    max-width: 66%;
    display: block;
    margin: 0 auto;
    z-index: 2;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    border-radius: 8px;
  }
  .mobile-poster-flip {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background: var(--background-main, #181818);
    z-index: 3;
    border-radius: 8px;
    padding: 0;
    box-sizing: border-box;
    transition: transform 0.4s;
    overflow: hidden;
  }
  .mobile-poster-flip.hide {
    display: none;
  }
  .mobile-poster-flip .film-info-title-group {
    width: 100%;
    text-align: left;
    margin: 1.1rem 1.2rem 0.5rem 1.2rem;
    padding: 0;
  }
  .mobile-poster-flip .film-info-title-group h3 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
    word-break: break-word;
  }
  .mobile-poster-flip .year-type {
    font-size: 1rem;
    color: #bbb;
    margin-bottom: 0.2rem;
  }
  .mobile-poster-flip .film-info-meta-group {
    width: 100%;
    margin: 0 1.2rem 0.5rem 1.2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }
  .mobile-poster-flip .film-info-meta-group p {
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
  }
  .mobile-poster-flip .film-info-meta-group p strong {
    font-weight: 600;
    color: var(--blue-main);
  }
  .mobile-poster-flip .film-info-actions-group {
    width: 100%;
    margin: 0.7rem 1.2rem 0 1.2rem;
    display: flex;
    flex-direction: row;
    gap: 0.7rem;
    justify-content: flex-start;
    align-items: center;
  }
  .mobile-poster-flip .imdb-btn,
  .mobile-poster-flip .trailer-link {
    font-size: 1rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    line-height: 1.2;
  }
  .mobile-poster-flip:after {
    content: 'Tap anywhere to return';
    display: block;
    width: 100%;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-top: auto;
    margin-bottom: 0.7rem;
    opacity: 0.7;
    pointer-events: none;
  }
}

@media (max-width: 600px) {
  .documentary-mini-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
  }
}

@media (max-width: 600px) {
  .film-mini-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
  }
  .mobile-poster-box {
    width: 100vw;
    max-width: 375px;
    min-width: 320px;
    aspect-ratio: 3/2;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto 1.2rem auto;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
  }
  /* ...rest unchanged... */
}

@media (max-width: 600px) {
  .mobile-poster-flip {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background: var(--background-main, #181818);
    z-index: 3;
    border-radius: 8px;
    padding: 0;
    box-sizing: border-box;
    transition: transform 0.4s;
    overflow: hidden;
  }
  .mobile-poster-flip .mobile-info-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    height: 100%;
    min-height: 0;
    margin-top: 12%; /* bring lower */
    margin-bottom: 0;
  }
  .mobile-poster-flip .film-info-title-group {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 1.1rem 1.2rem 0.5rem 1.2rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }
  .mobile-poster-flip .film-info-title-group h3 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
    word-break: break-word;
  }
  .mobile-poster-flip .year-type {
    font-size: 1rem;
    color: #bbb;
    margin-bottom: 0.2rem;
  }
  .mobile-poster-flip .film-info-meta-group {
    flex: 1 1 auto;
    margin: 3.2rem 1.2rem 3.2rem 1.2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    justify-content: center;
  }
  .mobile-poster-flip .film-info-meta-group p {
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
  }
  .mobile-poster-flip .film-info-meta-group p strong {
    font-weight: 600;
    color: var(--blue-main);
  }
  .mobile-poster-flip .film-info-actions-group {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0 0 0.7rem 0;
    padding: 0 1.2rem;
    display: flex;
    flex-direction: row;
    gap: 0.7rem;
    justify-content: flex-start;
    align-items: center;
    z-index: 2;
    background: transparent;
  }
  .mobile-poster-flip .imdb-btn {
    font-size: 1rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    line-height: 1.2;
    background: #ffe066;
    color: #222;
    font-weight: 600;
    border: none;
  }
  .mobile-poster-flip .trailer-link {
    font-size: 1rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    line-height: 1.2;
    background: var(--blue-main);
    color: #fff;
    font-weight: 600;
    border: none;
  }
  .mobile-poster-flip:after {
    content: 'Tap anywhere to return';
    display: block;
    width: 100%;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-top: auto;
    margin-bottom: 2.2rem;
    opacity: 0.7;
    pointer-events: none;
  }
}

@media (max-width: 600px) {
  .mobile-poster-flip {
    font-size: 85%;
  }
  .mobile-poster-flip * {
    font-size: inherit !important;
  }
}

@media (max-width: 600px) {
  .mobile-poster-flip {
    padding-top: 2.5rem;
  }
  .mobile-poster-flip .film-info-title-group {
    top: 0.2rem;
  }
  .mobile-poster-flip .mobile-info-content {
    margin-top: 1rem;
  }
}

@media (max-width: 600px) {
  .mobile-poster-flip .imdb-btn {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: #ffe066 !important;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    box-shadow: none !important;
    display: inline;
  }
  .mobile-poster-flip .imdb-btn:hover {
    text-decoration: underline;
  }
  .mobile-poster-flip .trailer-link {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: var(--blue-main) !important;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    box-shadow: none !important;
    display: inline;
  }
  .mobile-poster-flip .trailer-link:hover {
    text-decoration: underline;
  }
}

@media (max-width: 600px) {
  .mobile-poster-sideband {
    background: rgba(var(--blue-main-rgb, 50, 132, 201), 0.09) !important;
  }
}

@media (max-width: 600px) {
  .library-mini-title {
    font-size: 80% !important;
  }
}

.about-blog-container, .links-box {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0.5rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

.about-blog-container {
  margin-bottom: 5rem;
}

.commercial-mini-grid {
    margin-top: 3.5rem;
}

@media (max-width: 768px) {
  .poster-img img {
    filter: none !important;
  }
}
@media (max-width: 600px) {
  .poster-img img {
    filter: none !important;
  }
}

@media (max-width: 600px) {
  .bio-text {
    text-align: justify !important;
    margin-left: 0.05rem !important;
    margin-right: 0.05rem !important;
    margin-bottom: 1.2rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

@media (max-width: 600px) {
  .bio-container {
    margin-right: 0.02rem !important;
  }
}

.ext-link-line {
    display: flex;
    align-items: baseline;
    font-family: var(--body-font, inherit);
    font-size: 1.10rem;
    padding: 0.25rem 0 0.25rem 0.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    letter-spacing: 0.01em;
    margin-top: -0.2rem;
    margin-bottom: -0.2rem;
}
.ext-link-name {
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: 400;
    color: var(--blue-main);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: none;
    padding: 0.5rem 0.8rem 0.5rem 0;
    margin-right: 0.5em;
    text-decoration: none;
    transition: all 0.3s ease;
}
.ext-link-name:hover {
    text-decoration: underline;
    text-decoration-color: var(--blue-main);
    text-underline-offset: 4px;
    color: var(--blue-main);
}
.ext-link-dash {
    color: #fff;
    opacity: 0.7;
    margin-right: 0.5em;
}
.ext-link-desc {
    color: #fff;
    opacity: 0.85;
    font-weight: 400;
    font-size: 1rem;
}

/* Removed the min-width rule that was causing uneven spacing */

.film-info-details {
    font-size: 0.9rem;
}
.film-info-meta-group p {
    font-size: 0.9rem;
}

/* Language dropdown styled like .bio-button, 2D grid */
#global-language-switcher select {
    padding: 0.6rem 0.8rem;
    background-color: #000 !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    min-width: 60px;
    min-height: 1.5rem;
    box-sizing: border-box;
}
#global-language-switcher select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 152, 255, 0.1);
}
#global-language-switcher option {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: 0.9rem;
    padding: 0.3em 0.7em;
}

#global-language-switcher select:hover {
    border-color: var(--pink-main);
}

/* =============================
   RTL (Right-to-Left) SUPPORT
   ============================= */
[dir="rtl"] {
  direction: rtl;
  unicode-bidi: embed;
}

[dir="rtl"] body,
[dir="rtl"] .web-area,
[dir="rtl"] .page,
[dir="rtl"] .upload-container,
[dir="rtl"] .contact-container,
[dir="rtl"] .bio-container {
  text-align: right;
}

[dir="rtl"] .nav-menu {
  flex-direction: row-reverse;
}

[dir="rtl"] .form-group label,
[dir="rtl"] .form-group small,
[dir="rtl"] .contact-input,
[dir="rtl"] .file-input,
[dir="rtl"] .submit-btn,
[dir="rtl"] .reset-btn {
  text-align: right;
}

[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .category-dropdown,
[dir="rtl"] .contact-input {
  padding-right: 1rem;
  padding-left: 0.5rem;
}

[dir="rtl"] .form-row {
  direction: rtl;
}

[dir="rtl"] .bio-links,
[dir="rtl"] .form-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .upload-section h4,
[dir="rtl"] .project-title,
[dir="rtl"] .library-full-overlay h2,
[dir="rtl"] .library-mini-title {
  text-align: right;
}

[dir="rtl"] .ext-link-line {
  flex-direction: row-reverse;
}

[dir="rtl"] .ext-link-name {
  margin-right: 0;
  margin-left: 0.5em;
}

[dir="rtl"] .ext-link-dash {
  margin-right: 0;
  margin-left: 0.5em;
}

[dir="rtl"] .ext-link-desc {
  text-align: right;
}

/* Add more RTL overrides as needed for specific components */

[dir="rtl"] .logo-box-flex,
[dir="rtl"] .logo-box {
  direction: ltr !important;
  text-align: left !important;
  justify-content: flex-start !important;
}

/* Force LTR layout for LIBRARIES page content when in Arabic */
#libraries-page,
#libraries-page * {
  direction: ltr !important;
  text-align: left !important;
}

#libraries-page .libraries-intro-text {
  text-align: left !important;
  direction: ltr !important;
}

#libraries-page .library-mini-grid {
  direction: ltr !important;
}

#libraries-page .library-mini-title {
  text-align: left !important;
  direction: ltr !important;
}

#libraries-page .library-full-overlay h2 {
  text-align: left !important;
  direction: ltr !important;
}





 

