

.audio-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fondo oscuro semitransparente */
    z-index: 20; /* Asegura que esté por encima de todo lo demás en el player */
    
    /* Centrado perfecto con Flexbox */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    color: white;
    font-size: 1.2rem;
    font-style: italic;
    
    /* Para la transición de desaparición */
    transition: opacity 0.4s ease;
}

.audio-loading-overlay i {
    font-size: 2rem;
    margin-bottom: 15px;
}
.doc-container {
    text-align: center;
}

.archivoDisplay {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imageContainer {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: visible;
     background-image: url('/images/spinner.gif');
      background-position: center;
      background-repeat: no-repeat;
      background-size: 50px 50px;
}
#framepdf {
background-image: url('/images/spinner.gif');
      background-position: center;
      background-repeat: no-repeat;
      background-size: 50px 50px;
}

.archivoImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* audio styles */
.audioPlayerContainer {
 
}

.audioVideoContainer {
    width: 100%;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
}

.audioVideoContainer:hover .videoControls {
    opacity: 1;
}

.audioPlayer {
    width: 100%;
    height: 80px;
    background: transparent;
    display: none;
}

.oscillatorDisplay {
    width: 100%;
    height: 70px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--tertiary-color);
    position: relative;
    overflow: hidden;
}

.oscillatorCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.subtitlesDisplay {
    width: 100%;
    text-align: center;
    padding: 15px 20px;
    background: transparent;
    border-top: 1px solid var(--tertiary-color);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subtitleText {
    font-size: 1.5rem;
    color: var(--text-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    line-height: 1.4;
    border-radius: 8px;
    word-wrap: break-word;
    transition: opacity 1s ease-out;
    min-height: 1.5em;
}
.transcriptionIaWarn {
    text-align: center;
    font-style: italic;
    color: #666;


}

.transcriptionSearch {
    width: 100%;
    max-width: 800px;
    margin: 10 auto;
    background: #222;
}

.transcriptionSearchContainer {
    display: flex;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--tertiary-color) 100%);
    padding: 5px 20px;
    border-radius: 12px;
    border: 1px solid var(--tertiary-color);
    box-shadow: var(--card-shadow);
}

#transcriptionSearch {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--tertiary-color);
    background-color: var(--primary-color);
    color: var(--text-color);
    transition: var(--transition);
    margin: 0 auto;
    background: #222;
}

#transcriptionSearch:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(50, 203, 146, 0.2);
}

.transcriptionSearchNavigation {
    display: flex;
    align-items: center;
    gap: 5px;
}

#matchCounter {
    font-size: 0.9rem;
    color: var(--secondary-color);
    min-width: 50px;
    text-align: center;
}

.searchNavButton {
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.searchNavButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.searchNavButton:hover:not(:disabled) {
    background-color: var(--accent-hover-color);
}

.transcriptionContainer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--tertiary-color) 100%);
    border-radius: 12px;
    border: 1px solid var(--tertiary-color);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow-y: auto;
    padding: 25px;
    scrollbar-width: none;
    box-shadow: var(--card-shadow);
    max-height: 150px;
}

.transcriptionText {
    line-height: 1.6;
    color: var(--text-color);
    font-size: 0.95rem;
}

.transcriptionLoader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--secondary-color);
}

.transcriptionLoader i {
    font-size: 1.5rem;
}

.timeParagraph {
    margin-bottom: 2rem;
}

.transcriptionSegment {
    padding-right: 0.3rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    left: 0;
    transition: left 0.2s ease;
}

.transcriptionSegment:hover {
    left: 3px;
    color: var(--accent-color);
}

.transcriptionSegment.current-playing {
    color: var(--accent-hover-color);
}

.searchHighlight {
    background-color: rgba(255, 255, 0, 0.3);
    padding: 0 1px;
    border-radius: 2px;
}

.currentSearchHighlight {
    background-color: rgba(255, 165, 0, 0.5);
    box-shadow: 0 0 0 1px rgba(255, 165, 0, 0.3);
}

.videoControls {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: .3;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.videoContainer:hover .videoControls {
    opacity: 1;
}

.videoControlButton {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.videoControlButton:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.progressBar {
    flex-grow: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    transition: height 0.2s ease;
}

.progressBar:hover {
    height: 8px;
}

.progressBar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

.timeContainer {
    color: white;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

.volumeSlider {
    width: 80px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
}

.volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

@media (max-width: 768px) {
    .videoControls {
        padding: 10px 15px;
        gap: 10px;
    }

    .videoControlButton {
        font-size: 1rem;
    }

    .timeContainer {
        min-width: 70px;
        font-size: 0.8rem;
    }

    .volumeSlider {
        width: 60px;
    }

    .transcriptionSearchContainer {
        flex-direction: column;
        align-items: stretch;
    }

    .transcriptionSearchNavigation {
        justify-content: flex-end;
    }

    .transcriptionContainer {
        width: 100%;
        padding: 10px;
        max-height: 35vh;
    }

    #archivoAudio::cue {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .videoControls {
        padding: 8px 10px;
        gap: 8px;
    }

    .timeContainer {
        display: none;
    }

    .transcriptionSearchNavigation {
        justify-content: space-between;
    }

    .searchNavButton {
        width: 36px;
        height: 36px;
    }

    #archivoAudio::cue {
        font-size: 1rem;
    }
}

#collmi_subject {
    text-transform: inherit;
    color: white;
    font-family: 'Lato';
    font-weight: 400;
}
#collmi {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 11000;
    display: flex;
    justify-content: center;
    align-items: center;

    /* Estado inicial: totalmente oculto y no interactuable */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#collmi.active {
    opacity: 1;
    visibility: visible;
}
#collmi.active #collmi_c {
    transform: scale(1);
}

#collmi_player {
    flex: 1 1 auto;      /* Abreviatura para: flex-grow: 1, flex-shrink: 1, flex-basis: auto */
    min-height: 0;       /* ¡LA CLAVE! Permite que el contenedor se encoja más allá del tamaño de su contenido */
    overflow-y: auto;    /* Crea un scroll INTERNO si el contenido (ej. transcripción) es muy alto */
    display: flex;
    flex-direction: column;
    background: #000;
}
#collmi_c {
    background-color: #181818;
    color: white;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    width: 85vw;
    height: 90vh;
    max-width: 1300px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
#collmi_cls i {
    font-size: 22px;
    color: white;
    margin: 0;
}
#collmi a {
    color: white;
}
.audioPlayerContainer {
    display: flex;
    flex-direction: column;
    height: 100%; /* Ocupa el 100% de #collmi_player */
    gap: 0;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}
.audioVideoContainer {
    border-radius: 0;
}
.transcriptionContainer {
    flex-grow: 1; /* La transcripción ocupa el espacio sobrante */
    max-height: 30vh; /* Quitamos la altura máxima para que use el espacio flexible */
    border-radius: 0;
    max-width: 100%;
    position: relative; /* ¡MUY IMPORTANTE! Necesario para posicionar el degradado. */
}

#collmm {
    position: absolute;
    width: 100%;
    height: 90vh;
    background-color: #222;
    overflow: auto;
    z-index: 999;
    top: 0;
}

#collmi_clsc {
    position: absolute;
    bottom: 0;           /* Lo ancla al borde inferior de #collmi_c */
    left: 50%;           /* Mueve su borde izquierdo al centro exacto */
    transform: translate(-50%, 50%); /* Lo mueve -50% de su propio ancho (izquierda) y +50% de su propia altura (abajo) */
    z-index: 100;
    cursor: pointer;

    /* Re-aplicamos los estilos del diseño original */
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0; /* Reseteamos márgenes */
}

/* El círculo visible del botón */
#collmi_cls {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* Lo hacemos un círculo perfecto */
    transition: transform 0.2s ease, background-color 0.2s ease;
}


#collmi_cls i {
    font-size: 30px;
    margin: 0;
    color: white;
}

#collmi_cls a {
    color: white;
    font-size: 30px;
    /* padding-top: -10;*/
    margin-top: -5px;
}

@media (min-width: 768px) {
.audioVideoContainer {
        min-height: 220px;
    }
}
@media (max-width: 500px) {
    .audiovideoContainer {
            min-height: 25vh;
    }
}
@media (min-width: 601px) {
    #collmi_subject {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #collmi_clsc {
               position: absolute;
        top: 0;
        left: 95%;
        justify-content: flex-start !important;
        border-radius: 50%;
        border: 2px solid white;
        width: 50px;
        height: 50px;
        background: black;
        opacity: .3;
        animation: opacity 0.3s ease;
    }
    #collmi_cslc:hover{
        opacity: 1;
    }

    #collmi_cls {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    #collmi_cls i {
        font-size: 22px;
        color: white;
        margin: 0;
    }

    #collmi_cls a {
        font-size: 20px;
    }

   #itemdata {
    flex-shrink: 0;      /* Evita que esta área se encoja */
    overflow-y: auto;    /* También le damos su propio scroll si el texto es muy largo */
    max-height: 35vh;    /* Le damos una altura máxima para que nunca ocupe demasiado espacio */
    padding: 15px 25px;
    background-color: #222;
    border-top: 1px solid #333;
}

    #framepdf {
        height: 100%;
    }

      .spansocial {
        display: inline-block;
        padding: 0 10px;
    }
}
@media (max-width: 600px) {
    #collmi_clsc {
       position: absolute;
       border: 2px solid white;
        top: 12px;
        right: 12px;
        z-index: 100;
        cursor: pointer;
        background-color: rgba(0, 0, 0, 0.6);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s ease, transform 0.2s ease;
    }

    #player {
        width: 100%;
    }

    #collmi_cls i {
        font-size: 24px;
        margin: 0;
    }

    #collmi_cls {
        width: 50px;
        height: 50px;
    }
    #collmi_c {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    #framepdf {
        height: 100%;
    }

    .openseadragon-container {
        transition: height 0.5s;
    }

    #collmi_subject {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #collmi_actions {
        justify-content: space-between;
    }

    #social_actions {
        font-size: 25px;
        margin-top: -5px;
    }

    #collmi_actions,
    #collmi_data {
        width: 100%;
    }
    #itemdata {
        padding: 15px;
    }
    .transcriptionContainer {
        max-height: 25vh;
    }
    .spansocial {
        display: none;
    }
    .transcriptionSearchContainer {
        flex-direction: row;      /* ¡La clave! Fuerza los elementos a estar en una fila. */
        align-items: center;      /* Alinea todo verticalmente al centro. */
        padding: 5px 10px;        /* Un poco menos de padding para que todo quepa mejor. */
        gap: 8px;                 /* Reduce el espacio entre el input y los botones. */
    }

    #transcriptionSearch {
        padding: 8px 10px; /* Reduce un poco el padding vertical del input. */
        max-width: 50vw;
        margin: 0 auto;
        background: #222;

    }
    
    .transcriptionSearchNavigation {
        /* Se asegura de que el contador y los botones estén juntos. */
        flex-shrink: 0; 
    }
    .transcriptionIaWarn {
        font-size: 0.7rem;
    }
    .subtitleText {
        font-size: 1rem;
    }
}
@media (max-height: 650px) {
   
    #player {
        height: 55vh;
    }
}

@media (min-height: 651px) {
    #player {
        height: 60vh;
    }
    body.is-collmi-active {
    overflow: hidden;
}
}
    
