/* Archivo CSS para IE Shorts Plugin (Sin Tailwind) */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=PT+Serif:wght@400;700&display=swap');

:root {
    /* Variables de diseño de IE */
    --background: #ffffff;
    --foreground: #0f172a;
    --border: #e2e8f0;
    --primary: #003366;
    --primary-foreground: #ffffff;
    --card: #f8fafc;
    --text-sm: 0.875rem;
    --font-pt-serif: 'PT Serif', serif;
    --font-montserrat: 'Montserrat', sans-serif;
    --font-weight-bold: 700;
}

/* Resey styles for the main theme*/
.site-main .module.module_shorts{
    padding-bottom: 0px;
    position: relative;
}

/* Base reset for the plugin */
.ie-shorts-section, 
.ie-shorts-section *,
.ie-shorts-section *::before,
.ie-shorts-section *::after {
    box-sizing: border-box;
}

.ie-shorts-section {
    width: 100%;
    padding: 0 0 3rem 0;
}
@media (min-width: 768px) {
    .ie-shorts-section { padding: 0 0 4rem 0; }
}
@media (min-width: 1024px) {
    .ie-shorts-section { padding: 0 0 5rem 0; }
}

.ie-shorts-container {
    margin: 0 auto;
    padding: 0;
}

/* Header */
.ie-shorts-header { margin-bottom: 2rem; }
@media (min-width: 768px) { .ie-shorts-header { margin-bottom: 3rem; } }

.ie-shorts-title {
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    color: var(--foreground);
    font-size: 34px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-montserrat);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

.ie-shorts-subtitle {
    margin: 15px 0 0 0;
    color: var(--foreground);
    font-family: var(--font-pt-serif);
    font-weight: 400;
}

/* Carousel */
.ie-shorts-carousel-wrapper {
    position: relative;
}

.ie-shorts-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    background-color: var(--primary);
    color: var(--primary-foreground);
    cursor: pointer;
    transition: opacity 0.3s ease;
    opacity: 0;
    padding: 0;
}
@media (min-width: 768px) { .ie-shorts-arrow { display: flex; } }
.ie-shorts-carousel-wrapper:hover .ie-shorts-arrow { opacity: 1; }
.ie-shorts-arrow:disabled { opacity: 0; cursor: default; }

.ie-shorts-prev { left: 0; }
.ie-shorts-next { right: 0; }
.ie-shorts-arrow svg { width: 24px; height: 24px; }

.ie-shorts-embla {
    overflow: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.ie-shorts-embla::-webkit-scrollbar { display: none; }

.ie-shorts-embla-container {
    display: flex;
    gap: 0.75rem;
}
@media (min-width: 768px) { .ie-shorts-embla-container { gap: 1rem; } }
@media (min-width: 1024px) { .ie-shorts-embla-container { gap: 1.5rem; } }

.ie-shorts-slide {
    flex: 0 0 65%;
    min-width: 0;
}
@media (min-width: 640px) { .ie-shorts-slide { flex: 0 0 45%; } }
@media (min-width: 768px) { .ie-shorts-slide { flex: 0 0 30%; } }
@media (min-width: 1024px) { .ie-shorts-slide { flex: 0 0 22%; } }
@media (min-width: 1280px) { .ie-shorts-slide { flex: 0 0 18%; } }

/* Thumbnails */
.ie-shorts-thumbnail {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 9/16;
    background-color: var(--card);
}

.ie-shorts-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.ie-shorts-thumbnail:hover .ie-shorts-thumbnail-img { transform: scale(1.05); }

.ie-shorts-thumbnail-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ie-shorts-thumbnail:hover .ie-shorts-thumbnail-overlay { opacity: 0.5; }

.ie-shorts-play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}
.ie-shorts-thumbnail:hover .ie-shorts-play-btn { transform: scale(1); }
.ie-shorts-play-btn svg { width: 28px; height: 28px; margin-left: 4px; }

.ie-shorts-thumbnail-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.ie-shorts-thumbnail-title {
    color: white;
    margin: 0;
    font-family: var(--font-montserrat);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.ie-shorts-modal {
    position: fixed;
    inset: 0;
    /* Ensure the modal sits above theme headers/menus and other overlays */
    z-index: 999999;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    visibility: hidden;
}
.ie-shorts-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.ie-shorts-modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ie-shorts-modal-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.75rem;
    height: 85vh;
    width: auto;
    max-width: 95vw;
    outline: none;
}
@media (min-width: 640px) {
    .ie-shorts-modal-content { gap: 1rem; height: 90vh; }
}

.ie-shorts-video-wrapper {
    position: relative;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background-color: black;
    flex-shrink: 0;
    aspect-ratio: 9/16;
}
.ie-shorts-video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.ie-shorts-video-tap-layer {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: auto;
}

.ie-shorts-swipe-preview-layer {
    position: absolute;
    inset: 0;
    z-index: 11;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0);
}

.ie-shorts-swipe-preview-layer.is-active {
    opacity: 1;
}

.ie-shorts-swipe-preview-layer.is-animating {
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.ie-shorts-swipe-preview-panel {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.ie-shorts-swipe-preview-panel.is-next {
    transform: translateY(100%);
}

.ie-shorts-swipe-preview-panel.is-current {
    transform: translateY(0);
}

.ie-shorts-swipe-preview-panel.is-previous {
    transform: translateY(-100%);
}

.ie-shorts-swipe-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* External Controls */
.ie-shorts-modal-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem 0;
    flex-shrink: 0;
}
@media (min-width: 640px) { .ie-shorts-modal-controls { padding: 1rem 0; } }

.ie-shorts-controls-top,
.ie-shorts-controls-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}
@media (min-width: 640px) { .ie-shorts-controls-top, .ie-shorts-controls-bottom { gap: 1rem; } }

.ie-shorts-controls-bottom { margin-bottom: 0.5rem; }
@media (min-width: 640px) { .ie-shorts-controls-bottom { margin-bottom: 2rem; } }

.ie-shorts-control-btn {
    border: none;
    border-radius: 50%;
    padding: 10px;
    background-color: var(--card);
    color: var(--foreground);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (min-width: 640px) { .ie-shorts-control-btn { padding: 12px; } }

.ie-shorts-control-btn:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
}
.ie-shorts-control-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.ie-shorts-control-btn:disabled:hover {
    background-color: var(--card);
    color: var(--foreground);
}
.ie-shorts-control-btn svg { width: 20px; height: 20px; }
@media (min-width: 640px) { .ie-shorts-control-btn svg { width: 24px; height: 24px; } }

/* Share sheet */
.ie-shorts-share-sheet {
    position: absolute;
    right: 90px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    padding: 10px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.ie-shorts-share-sheet.is-open {
    opacity: 1;
    pointer-events: auto;
}
.ie-shorts-share-sheet-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ie-shorts-share-action {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--card);
    color: var(--foreground);
    cursor: pointer;
    min-width: 160px;
}
.ie-shorts-share-action:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
}
.ie-shorts-share-action svg {
    width: 18px;
    height: 18px;
}

.ie-shorts-share-action {
    position: relative;
}

.ie-shorts-copy-toast {
    position: absolute;
    right: 10px;
    top: -10px;
    transform: translateY(-8px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    white-space: nowrap;
}
.ie-shorts-copy-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Portrait mobile: show top controls overlaying the video (YouTube-like). */
@media (max-width: 639px) and (orientation: portrait) {
    .ie-shorts-modal-content {
        flex-direction: column;
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        gap: 0;
    }

    .ie-shorts-video-wrapper {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .ie-shorts-modal-controls {
        position: absolute;
        inset: 0;
        padding: 0;
        pointer-events: none;
    }

    .ie-shorts-controls-top {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 20;
        pointer-events: auto;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .ie-shorts-controls-top.is-hidden {
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
    }

    .ie-shorts-controls-bottom {
        position: absolute;
        right: 12px;
        bottom: calc(56px + env(safe-area-inset-bottom));
        z-index: 20;
        margin-bottom: 0;
        pointer-events: auto;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .ie-shorts-controls-bottom.is-hidden {
        opacity: 0;
        transform: translateY(8px);
        pointer-events: none;
    }

    .ie-shorts-video-tap-layer {
        z-index: 15;
        pointer-events: auto;
        touch-action: none;
    }
}
