/* Añade esto al principio de tu CSS */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    filter: brightness(0.7);
    
    /* Rotación condicional */
    transform: rotate(0deg);
    transition: transform 0.5s ease;
}

/* Cuando la altura es mayor que el ancho (modo vertical) */
@media (orientation: portrait) {
    .video-background iframe {
        transform: rotate(90deg);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Georgia', serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    background-color: rgba(0, 0, 0, 0.5);
}

.poem-container {
    width: 80%;
    max-width: 800px;
    text-align: center;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 60px 0; /* Espacio para barra y controles */
}

.poem-line {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    line-height: 1.4;
    margin-bottom: 2rem;
    opacity: 0;
    position: absolute;
    width: 100%;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 10%;
}

.title, .author {
    font-size: clamp(2rem, 6vw, 4rem);
    opacity: 0;
    padding: 0 10%;
}

.title {
    margin-bottom: 1.5rem;
}

.author {
    font-style: italic;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

/* Barra de progreso - posición general */
.progress-container {
    width: 90%;
    max-width: 800px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 auto;
    border-radius: 5px;
    cursor: pointer;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #fff;
    border-radius: 5px;
    transition: width 0.1s linear;
}

/* Controles - posición general */
.controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: all 0.3s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.volume-container {
    display: flex;
    align-items: center;
    width: 100px;
}

#volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#volume-slider:hover {
    opacity: 1;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* Media Queries para móviles */
@media (max-width: 768px) {
    .poem-container {
        width: 90%;
        margin: 50px 0 80px; /* Más espacio para controles */
    }

    .poem-line {
        font-size: clamp(1.6rem, 6vw, 2.5rem);
        line-height: 1.5;
        padding: 0 5%;
    }

    .title {
        font-size: clamp(1.8rem, 7vw, 3rem);
        margin-bottom: 1rem;
    }

    .author {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }

    .progress-container {
        top: 15px;
        height: 6px;
        width: 85%;
    }

    .controls {
        bottom: 15px;
        gap: 8px;
        padding: 8px 15px;
        width: 90%;
        justify-content: space-between;
    }

    .control-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .volume-container {
        display: none; /* Ocultamos el volumen en móviles para más espacio */
    }

    #mute-btn {
        display: flex; /* Mostramos solo el botón de mute */
    }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 480px) {
    .controls {
        gap: 5px;
        padding: 6px 10px;
    }

    .control-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .poem-line {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }
}

/* Ajustes para orientación horizontal */
@media (max-width: 768px) and (orientation: landscape) {
    .poem-container {
        margin: 30px 0 60px;
    }

    .controls {
        bottom: 10px;
    }

    .progress-container {
        top: 10px;
    }
}
