* {
    box-sizing: border-box;
}

:root {
    --primary: #9146FF;
    --text-main: #ffffff;
    --text-muted: #888888;
    --border: rgba(255, 255, 255, 0.1);
    --success: #00df9a;
    --glow-shadow: 0 0 20px rgba(145, 70, 255, 0.3);
    --primary-hover: #7c2cf2;
}

/* Fix Chrome Autofill White Background */
.url-input:-webkit-autofill,
.url-input:-webkit-autofill:hover,
.url-input:-webkit-autofill:focus,
.url-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #000 inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

body {
    background-color: #050505;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    /* Respetar la zona segura (status bar / notch) en app y móvil */
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    z-index: 1;
    width: 100%;
    margin-bottom: 1vh;
    /* Reduce margin */
    flex-shrink: 0;
    text-align: center;
    width: 100%;
}

.header h1 {
    font-size: 2rem;
    /* Larger app name; the version sits on its own second line */
    font-weight: 700;
    letter-spacing: -0.04em;
    white-space: nowrap;
    background: linear-gradient(135deg, #fff 30%, #a5a5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.header h1 .app-version {
    display: block;
    font-size: 0.975rem;
    font-weight: 500;
    letter-spacing: 0;
    margin-top: 2px;
    /* Opt out of the h1 gradient so the version stays legible */
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--primary);
    opacity: 0.85;
}

.header h2 {
    font-size: 0.9rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    margin-top: 5px;
    opacity: 0.9;
}

.header p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.input-section {
    background: rgba(10, 10, 10, 0.5);
    padding: 0;
    backdrop-filter: blur(10px);
}

.url-input {
    width: 100%;
    padding: 15px;
    /* Padding simétrico, sin espacio extra para el botón */
    border: 1px solid var(--primary) !important;
    /* Violet border ALWAYS */
    border-radius: 12px;
    font-size: 1rem;
    background: #000 !important;
    color: #fff !important;
    font-family: 'Inter', monospace;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: all 0.2s ease;
    appearance: none;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), inset 0 2px 4px rgba(0, 0, 0, 0.8);
    transform: translateY(0);
}

.url-input::placeholder {
    color: #444;
}

.buttons-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
    width: 100%;
    align-items: stretch;
}

.btn-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
}

/* Spinner del modal de progreso: anillo clásico (segmento de color girando) */
@keyframes pm-spin {
    to { transform: rotate(360deg); }
}

.pm-ring {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: #4facfe;
    animation: pm-spin 0.8s linear infinite;
}

.btn {
    width: 100%;
    height: 100%;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* --- Botones de acción: colores de marca (como los íconos de arriba) --- */

/* Pegar = rojo YouTube (siempre activo) */
#pasteBtn {
    background: linear-gradient(145deg, #ff4d4d, #e60000);
    border-color: rgba(255, 0, 0, 0.5);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.3);
}

#pasteBtn:hover {
    background: linear-gradient(145deg, #ff6666, #ff1a1a);
    box-shadow: 0 0 26px rgba(255, 0, 0, 0.5);
}

/* Descargar = violeta Twitch */
#mainDownloadBtn.active {
    background: linear-gradient(145deg, #a970ff, #7c2cf2);
    border-color: rgba(145, 70, 255, 0.6);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    box-shadow: 0 4px 16px rgba(145, 70, 255, 0.32);
}

#mainDownloadBtn.active:hover {
    background: linear-gradient(145deg, #b98bff, #8a44ff);
    box-shadow: 0 0 26px rgba(145, 70, 255, 0.5);
}

/* Compartir = azul Facebook */
#mainShareBtn.active {
    background: linear-gradient(145deg, #4293ff, #1877f2);
    border-color: rgba(24, 119, 242, 0.6);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.32);
}

#mainShareBtn.active:hover {
    background: linear-gradient(145deg, #5aa3ff, #2b86ff);
    box-shadow: 0 0 26px rgba(24, 119, 242, 0.5);
}

/* Botones de acción aún sin video activo: apagados */
#mainDownloadBtn:not(.active),
#mainShareBtn:not(.active) {
    opacity: 0.5;
    pointer-events: none;
}

.btn:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.5);
    box-shadow: none !important;
    transform: none !important;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 0;
}

.clear-input-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 12px 16px;
    display: none;
    transition: all 0.2s ease;
    border-radius: 12px;
    flex-shrink: 0;
    height: 48px;
    min-width: 48px;
}

.clear-input-btn:hover {
    color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.3);
}

/* Restore original preview styles from HEAD */
.netflix-loading {
    width: 200px;
    margin: 0 auto;
    display: block;
}

.netflix-loading-content {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%;
    /* 9:16 Aspect Ratio */
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 50;
}

.netflix-loading-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 60;
}

.netflix-platform-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: netflixPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px currentColor);
}

.netflix-platform-icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.netflix-platform-icon.linkedin {
    color: #0077B5;
}

.netflix-platform-icon.twitter {
    color: #1DA1F2;
}

.netflix-platform-icon.twitch {
    color: #9146FF;
}

.platform-svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 15px;
    animation: netflixPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px currentColor);
}

.platform-svg.instagram {
    fill: url(#instagram-gradient);
}

.platform-svg.linkedin {
    fill: #0077B5;
}

.platform-svg.twitter {
    fill: #000000;
}

.platform-svg.tiktok {
    fill: #ff0050;
}

.platform-svg.facebook {
    fill: #1877f2;
}

.platform-svg.youtube {
    fill: #ff0000;
}

.netflix-loading-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 15px;
    animation: textFade 2s ease-in-out infinite;
}

.netflix-progress-bar {
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.netflix-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 200% 100%;
    animation: netflixProgress 2.5s ease-in-out infinite;
    border-radius: 2px;
    width: 0%;
}

@keyframes netflixPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes netflixProgress {
    0% {
        width: 0%;
        background-position: 0% 50%;
    }

    50% {
        width: 70%;
        background-position: 100% 50%;
    }

    100% {
        width: 100%;
        background-position: 0% 50%;
    }
}

@keyframes textFade {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.error-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 90vw;
    text-align: center;
    animation: errorSlideIn 0.4s ease-out;
}

.error-modal.closing {
    animation: errorSlideOut 0.3s ease-in forwards;
}

.error-modal h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #FF6B6B;
}

.error-modal p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

@keyframes errorSlideIn {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes errorSlideOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.error h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    body {
        overflow: hidden;
        /* En mobile el .container maneja la zona segura (es 100dvh); el body
           no debe agregar padding o empujaría el contenido fuera de pantalla. */
        padding: 0 !important;
    }

    .container {
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
        /* Más aire abajo para que los botones no queden pegados al borde/barra */
        padding-bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
        display: flex;
        flex-direction: column;
        height: 100dvh;
        max-height: 100dvh;
        justify-content: center;
        overflow: hidden;
    }

    .header {
        margin-bottom: 5px;
        padding-bottom: 0;
        flex-shrink: 0;
    }

    .header h1 {
        font-size: 1.5rem;
        line-height: 1.2;
        margin-bottom: 4px;
        white-space: nowrap;
    }

    .header h1 .app-version {
        font-size: 0.875rem;
    }

    .header h2 {
        font-size: 0.8rem;
        margin-top: 0;
        margin-bottom: 8px;
        display: block;
        opacity: 0.8;
    }

    .header p {
        display: none;
    }

    .pro-video-card-inner {
        padding-bottom: 0 !important;
        height: 100%;
    }

    .header-icon,
    .btn-icon {
        display: none !important;
    }

    .video-player-section {
        padding: 10px;
        margin-bottom: 5px;
        min-height: 0;
        flex: 1;
        flex-shrink: 1;
        margin-top: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .video-placeholder-content,
    .netflix-loading-content,
    .pro-video-card {
        height: 100%;
        max-height: 100%;
        width: auto;
        aspect-ratio: 9/16;
        margin: 0 auto;
    }

    .video-placeholder-content {
        width: 100% !important;
    }

    .input-section {
        margin-top: 0;
        padding-top: 0;
        flex-shrink: 0;
        position: static;
        height: auto;
        background: transparent;
        border-top: none;
        box-shadow: none;
        padding: 0;
        width: 100%;
    }

    .header p {
        font-size: 0.8rem;
        margin-top: 2px;
        margin-bottom: 5px;
        display: block;
        line-height: 1.2;
    }

    .input-container {
        gap: 6px;
        margin-bottom: 8px;
    }

    .url-input {
        padding: 10px 14px;
        font-size: 0.9rem;
        height: 44px;
    }

    .clear-input-btn {
        padding: 10px 12px;
        font-size: 1rem;
        height: 44px;
        min-width: 44px;
    }

    .buttons-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
        margin-top: 5px;
        width: 100% !important;
    }

    /* Con 3 botones entra el ícono + la etiqueta también en mobile */
    .btn-svg {
        width: 18px;
        height: 18px;
    }

    .btn {
        padding: 0 4px;
        font-size: 0.8rem;
        height: 46px;
        min-height: 46px;
        width: 100%;
        white-space: nowrap;
        min-width: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .btn.download-main {
        width: 100% !important;
        margin-top: 0 !important;
        flex: unset;
    }
}

@media (max-width: 380px),
(max-height: 740px) {
    .container {
        padding: 5px !important;
    }

    .header {
        margin-bottom: 2px !important;
    }

    .header h1 {
        font-size: 1.25rem !important;
        margin-bottom: 2px !important;
        white-space: nowrap !important;
    }

    .header h1 .app-version {
        font-size: 0.825rem !important;
    }

    .header h2 {
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
    }

    .header p {
        font-size: 0.65rem !important;
        margin: 2px 0 4px 0 !important;
        display: block !important;
    }

    .video-player-section {
        padding: 4px !important;
        margin-bottom: 4px !important;
    }

    .video-placeholder-content,
    .netflix-loading-content,
    .pro-video-card {
        max-height: 40vh !important;
    }

    .input-container {
        gap: 4px !important;
        margin-bottom: 4px !important;
    }

    .url-input {
        padding: 6px 10px !important;
        font-size: 0.85rem !important;
        height: 34px !important;
    }

    .clear-input-btn {
        padding: 6px 8px !important;
        font-size: 0.9rem !important;
        height: 34px !important;
        min-width: 34px !important;
    }

    .buttons-container {
        gap: 4px !important;
        margin-top: 4px !important;
    }

    .btn {
        padding: 0 4px !important;
        font-size: 0.72rem !important;
        height: 34px !important;
    }
}

.video-player-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2vh 2vw;
    margin-bottom: 3vh;
    backdrop-filter: blur(10px);
    min-height: 25vh;
    /* Usar 25% del viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.video-placeholder {
    width: 200px;
    margin: 0 auto;
    display: block;
}

.video-placeholder-content {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%;
    /* 9:16 Aspect Ratio */
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.video-card-container,
.video-thumbnail-container.video-card-container {
    width: 200px !important;
    margin: 0 auto !important;
    display: block !important;
}

.video-placeholder-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.video-placeholder-icon {
    font-size: 2rem;
    opacity: 0.6;
}

.video-placeholder-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

#videoPlayerContainer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.pro-video-card {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    border-radius: 24px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.pro-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.pro-video-card-inner {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    background: #000;
}

.pro-video-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.icon-item {
    position: relative;
    cursor: default;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.icon-item svg {
    width: 28px;
    height: 28px;
    transition: filter 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.icon-item:hover {
    transform: scale(1.3) translateY(-5px);
    z-index: 10;
}

.icon-item:hover svg {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

.icon-item[data-label="Instagram"]:hover svg {
    filter: drop-shadow(0 0 15px rgba(225, 48, 108, 0.6));
}

.icon-item[data-label="LinkedIn"]:hover svg {
    filter: drop-shadow(0 0 15px rgba(0, 119, 181, 0.6));
}

.icon-item[data-label="X"]:hover svg {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
}

.icon-item[data-label="TikTok"]:hover svg {
    filter: drop-shadow(0 0 15px rgba(255, 0, 80, 0.6));
}

.icon-item[data-label="Facebook"]:hover svg {
    filter: drop-shadow(0 0 15px rgba(24, 119, 242, 0.6));
}

.icon-item[data-label="YouTube"]:hover svg {
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.6));
}

.icon-item[data-label="Twitch"]:hover svg {
    filter: drop-shadow(0 0 15px rgba(145, 70, 255, 0.6));
}

.icon-item[data-label="Pinterest"]:hover svg {
    filter: drop-shadow(0 0 15px rgba(230, 0, 35, 0.6));
}

.icon-item::after {
    content: attr(data-label);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.icon-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* SVG Definitions */
.svg-defs {
    width: 0;
    height: 0;
    position: absolute;
}

/* Header Icons */
.header-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0 25px;
}

/* Social Icons */
.social-icon-svg {
    width: 24px;
    height: 24px;
}

/* SweetAlert Progress Modal */
.swal-progress-container {
    margin-top: 20px;
}

.swal-progress-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 16px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 10px;
}

.swal-progress-bar {
    width: 2%;
    background: linear-gradient(90deg, #00ff88, #00b3ff);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.swal-progress-text {
    color: #ccc;
    font-family: monospace;
    font-size: 14px;
}

/* Card JS Refactored Styles */
.card-video-container {
    width: 100%;
    height: 100%;
    padding-bottom: 177.78%;
    /* 9:16 Aspect Ratio */
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card-video-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Platform Icon Overlay (New) */
.platform-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}

.video-thumbnail-container:hover .platform-icon-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

.platform-icon-svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Ensure YouTube-style button is hidden or removed if still present */
.ytp-large-play-button {
    display: none !important;
}

/* YouTube Pro Styles */
.pro-video-glossy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
    z-index: 5;
}

/* Cinema Player Styles */
.cinema-video {
    width: 100%;
    max-height: 70vh;
}

/* LinkedIn JS Refactored Styles */
.linkedin-video-card {
    border: none;
    background: transparent;
    box-shadow: none;
    display: flex;
    justify-content: center;
}

.linkedin-preview-container {
    position: relative;
    width: 200px;
    aspect-ratio: 9/16;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.linkedin-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(0, 119, 181, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 4px;
}

.linkedin-thumb-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.linkedin-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.linkedin-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    padding-top: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    z-index: 10;
}

.linkedin-title {
    color: white;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.linkedin-pdf-bg {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #3b82f6, #1e3a8a);
    display: flex;
    align-items: center;
    justify-content: center;
}

.linkedin-pdf-icon {
    opacity: 0.7;
}

/* Card Video Styles */
.card-video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Reproductor inline: ocupa el mismo lugar que la miniatura, pero con
   object-fit: contain en vez de cover. La tarjeta es 9:16 y un video horizontal
   quedaría recortado a los costados con cover; acá se prioriza ver el cuadro
   completo sobre llenar el marco. */
.card-player {
    object-fit: contain;
    background: #000;
    z-index: 3;
}

/* Spinner discreto mientras se prepara el archivo. A propósito NO es un modal:
   la reproducción no anuncia que está descargando. */
.card-player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    z-index: 4;
}

.card-player-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: card-player-spin 0.9s linear infinite;
}

@keyframes card-player-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .card-player-spinner {
        animation-duration: 2.4s;
    }
}

.card-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    color: rgba(255, 255, 255, 0.9);
    z-index: 20;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Video Modal & Cinema Modal Styles */
.video-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: 9999;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    transform: translateX(0) !important;
    /* Forzar centrado */
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.video-modal video {
    width: 100%;
    max-height: 80vh;
    display: block;
}

.video-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.video-modal-close:hover {
    background: rgba(255, 0, 0, 0.8);
}

.video-modal-footer {
    padding: 15px;
    background: #111;
    display: flex;
    justify-content: flex-end;
}

.video-modal-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #00df9a;
    color: #000;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s;
}

.video-modal-download-btn:hover {
    background: #00b37e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 223, 154, 0.3);
}

.video-modal-download-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.cinema-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}