/* Header */
.webinar-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align items to the left */
    padding: 10px 0;
    border-bottom: 1px solid var(--borde-gris-claro);
    margin-bottom: 10px;
    gap: 10px; /* Add space between logo and title */
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--morado-corporativo);
}
.logo-img { height: 40px; width: auto; border-radius: 6px; }
.webinar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--texto-gris-medio);
    margin: 0;
    width: 100%; /* Make title take full width */
    text-align: center; /* Center the text inside */
}

/* Fullscreen Unmute Prompt */
#fullscreen-unmute-prompt {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 100;
    cursor: pointer;
}

.prompt-content {
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.prompt-content svg {
    margin-bottom: 10px;
}

.prompt-content h2 {
    font-size: 1.5rem;
    font-weight: 500;
}

/* Main container and layout */
.main-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
    min-height: calc(100vh - 40px); /* Adjust for padding */
}
.webinar-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: 25px;
    align-items: start; /* Align items to the top */
    flex-grow: 1;
    min-height: 0; /* Prevent overflow in flex container */
}

.chat-section {
    height: auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background-color: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--borde-gris-claro);
}
#video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

#countdown-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(8px);
    color: var(--texto-negro);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 20px 5px;
    overflow-y: auto;
}
#countdown-overlay h2, #countdown-overlay p {
    pointer-events: auto; /* Re-enable events for text */
}
#countdown-overlay h2 { font-family: 'Playfair Display', serif; font-size: 2.5rem; margin-bottom: 5px; }
#countdown-overlay p { font-size: 1.2rem; }

/* Other UI elements */
#live-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #e53e3e;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 5;
}

#viewer-count {
    position: absolute;
    top: 45px;
    left: 15px;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    z-index: 11; /* Asegura que esté sobre el overlay */
}

#volume-control-container {
    position: absolute;
    bottom: 22px;
    left: 65px; /* Position next to the sound toggle */
    display: flex;
    align-items: center;
    z-index: 15;
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px; /* Expand on hover */
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
    transition: width 0.3s ease-in-out;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: var(--morado-corporativo);
    border-radius: 50%;
}

#volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: var(--morado-corporativo);
    border-radius: 50%;
    border: none;
}

#sound-toggle {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 15;
}

#sound-toggle svg { width: 20px; height: 20px; }

.welcome-notification {
    min-width: 250px; /* Ensure it's wide enough for names */
    text-align: center;
    white-space: nowrap; /* Prevent name from wrapping */
}

.floating-reaction {
    position: absolute;
    bottom: 60px; /* Start above controls */
    font-size: 2rem;
    animation: float-up 2s ease-out forwards;
    pointer-events: none;
    z-index: 12;
}

/* Responsive */
.special-offer-btn {
    display: none;
    background: #6a1b9a;
    color: #fff;
    border: none;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    text-decoration: none;
    line-height: 1.2;
    width: 100%;
    text-align: center;
}

#mobile-pdf-btn-slot {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.bonus-form-container {
    background: var(--fondo-blanco);
    border: 1px solid var(--borde-gris-claro);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.bonus-form-container h3 {
    font-family: 'Playfair Display', serif;
    color: var(--morado-corporativo);
    margin: 0 0 15px 0;
}

#bonus-form {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#bonus-form input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--borde-gris-claro);
    background: var(--fondo-blanco);
    color: var(--texto-negro);
    font-size: 0.9rem;
}

#bonus-form button {
    background: linear-gradient(180deg, #6B2A78 0%, #4D1F57 100%);
    color: var(--fondo-blanco);
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .webinar-layout { grid-template-columns: 1fr; }
    .chat-section { max-height: 80vh; }
    #bonus-form { flex-direction: column; }
}

/* Video Loading Overlay */
#video-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(8px);
    color: var(--texto-negro);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 12; /* Encima del video pero debajo de otros prompts */
}

#video-loading-overlay .spinner {
    border: 6px solid rgba(0, 0, 0, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border-left-color: var(--morado-corporativo);
    animation: spin 1.2s linear infinite;
    margin-bottom: 25px;
}

#video-loading-overlay p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--texto-negro);
    text-align: center;
    max-width: 90%;
}

#loading-error-message {
    color: #c53030; /* Un color rojo oscuro para errores */
    font-weight: 600;
    font-size: 1.2rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Webinar End Overlay */
#webinar-end-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    color: var(--texto-negro);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    padding: 20px;
}

#webinar-end-overlay h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--morado-corporativo);
}

#webinar-end-overlay p {
    font-size: 0.8rem;
    max-width: 80%;
    margin-bottom: 20px;
}

#webinar-end-overlay span {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--morado-corporativo);
}