:root {
    --app-height: 100vh;
}

#ctw-tiktok-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    z-index: 99999 !important;
    height: var(--app-height) !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #000;
}

#ctw-main-preloader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    transition: opacity 0.5s ease;
}

#ctw-main-preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.ctw-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ctw-spin 1s linear infinite;
}

@keyframes ctw-spin {
    to {
        transform: rotate(360deg);
    }
}

.ctw-desktop-view, .ctw-video-wrapper {
    width: 100% !important;
    height: 100% !important;
}

.ctw-video-list {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

.ctw-video-track {
    height: 100% !important;
    transition: transform 0.4s ease-in-out; 
}

.ctw-video-item {
    width: 100% !important;
    height: 100% !important; 
    position: relative !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctw-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* --- ESTILOS PARA EL OVERLAY DE PLAY/PAUSA --- */
.ctw-play-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 5;
    cursor: pointer;
    opacity: 0; /* Oculto por defecto */
    pointer-events: none; /* No se puede hacer clic por defecto */
    transition: opacity 0.2s ease;
}

.ctw-play-pause-overlay.visible {
    opacity: 1;
    pointer-events: auto; /* Se puede hacer clic cuando está visible */
}

.ctw-play-pause-overlay .play-icon {
    transform: scale(1);
    transition: transform 0.2s ease;
}

.ctw-play-pause-overlay:hover .play-icon {
    transform: scale(1.1); /* Efecto sutil al pasar el mouse */
}
/* --- FIN ESTILOS OVERLAY --- */

.ctw-video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 6;
}

.ctw-video-actions-left, .ctw-video-actions-right {
    pointer-events: auto;
}

.ctw-sound-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin-bottom: 25px;
}

.ctw-action-btn {
    display: inline-block;
    text-decoration: none;
    background-color: #FE2C55;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    text-transform: uppercase;
    margin-bottom: 25px;
}

.ctw-action-btn:hover {
    background-color: #e02046;
    color: white;
}

.ctw-home-button {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctw-navigation { display: none; }

@media (min-width: 768px) {
    /* Estilos de escritorio (sin cambios) */
    body.ctw-active { overflow: hidden; }
    #ctw-tiktok-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(0, 0, 0, 0.8); display: flex; justify-content: center; align-items: center; z-index: 99999; }
    .ctw-desktop-view { width: 100%; max-width: 450px; height: 90vh; max-height: 800px; background: #000; border-radius: 12px; }
    .ctw-video-wrapper, .ctw-video-list, .ctw-video-item { height: 100% !important; border-radius: 12px; }
    .ctw-navigation { display: block; position: absolute; right: -70px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 15px; }
    .ctw-nav-btn { background: rgba(255, 255, 255, 0.2); border: none; border-radius: 50%; width: 48px; height: 48px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
    .ctw-nav-btn:hover { background: rgba(255, 255, 255, 0.4); }
}