/* ===== Encoder Page Styles ===== */

/* Encoder Page Font */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

.encoder-page {
    font-family: 'Montserrat', 'Inter', sans-serif;
}

/* Encoder Header */
.header-encoder .header-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-encoder .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.header-encoder .logo img {
    height: 50px;
}

.header-encoder .desktop-nav {
    gap: 12px;
    align-items: center;
}

/* Allow video section to grow */
#video.product-section {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

/* Section title center */
.section-title-center {
    font-weight: 900;
    color: #fff;
    text-align: center;
}

/* Encoder hero title */
.encoder-hero-title {
    color: #fff;
    font-weight: 700;
    text-align: center;
}

/* Variables Grid */
.variables-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.variable-tile {
    border: 1px solid rgba(0, 102, 255, .2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: .15s;
    background: transparent;
}

.variable-tile i {
    color: #0066FF;
}

.variable-tile:hover {
    border-color: rgba(0, 102, 255, .4);
    background: rgba(0, 102, 255, .07);
}

/* Info Cards */
.info-card {
    border: 1px solid rgba(0, 102, 255, .3);
    border-radius: 12px;
    padding: 16px;
}

.info-card h3 {
    color: #0066FF;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
}

.info-card p {
    color: #ccc;
    text-align: center;
}

.info-card .encoder-title {
    color: #fff;
    font-weight: 900;
    font-size: 19px;
    text-align: left;
    letter-spacing: .02em;
}

.ip-card {
    border: 1px solid rgba(0, 255, 102, .3);
}

.ip-card h3 {
    color: #00FF66;
}

.info-card-dark {
    background: rgba(0, 0, 0, .25);
}

/* Video Frames */
.video-frame {
    border: 6px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 102, 255, .15);
    background: #000;
    overflow: hidden;
}

.video-frame video {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
}

.video-frame.video-large {
    transform: none;
}

.video-label {
    color: rgba(255, 255, 255, .7);
    font-weight: 700;
    letter-spacing: .03em;
}

/* Accordion (Bootstrap dark theme) */
.accordion .accordion-button {
    font-weight: 700;
    color: #0066FF;
}

.accordion .accordion-body {
    color: #bbb;
}

#video .product-content {
    transform: translateY(-15%);
}

#video .accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-color: var(--text-white);
    --bs-accordion-btn-bg: transparent;
    --bs-accordion-btn-color: #2F8FFF;
    --bs-accordion-btn-focus-box-shadow: none;
    --bs-accordion-border-color: var(--border-color);
    --bs-accordion-active-color: #2F8FFF;
    --bs-accordion-active-bg: rgba(0, 0, 0, 0.2);
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%232F8FFF' d='M1.5 6l6 6 6-6'/%3e%3c/svg%3e");
    --bs-accordion-btn-active-icon: var(--bs-accordion-btn-icon);
}

#video .accordion .accordion-item {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

#video .accordion .accordion-button {
    background: transparent;
    color: #2F8FFF;
    font-size: 0.8rem;
}

#video .accordion .accordion-button:not(.collapsed) {
    color: #2F8FFF;
    box-shadow: none;
}

#video .accordion .accordion-body {
    background: transparent;
    color: var(--text-gray);
    font-size: 0.8rem;
}

#video .accordion .accordion-button:focus {
    box-shadow: none;
}

#video .info-card .intro-text {
    font-size: 0.72rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .75);
}

/* Data Tables */
.data-table {
    border: 1px solid rgba(0, 102, 255, .2);
    border-radius: 12px;
    overflow: auto;
}

.data-table table {
    width: 100%;
    color: #fff;
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.csv-btn {
    background: #0066FF;
    color: #fff;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

/* Comparison Section */
#comparison .section-title {
    text-align: center;
    font-weight: 900;
    font-size: 26px;
}

#comparison .section-subtitle {
    color: rgba(255, 255, 255, .7);
    text-align: center;
    max-width: 1100px;
    margin: 8px auto 0;
}

.comparison-note {
    color: rgba(255, 255, 255, .6);
    text-align: center;
    font-style: italic;
    max-width: 1100px;
    margin: 8px auto;
}

.comparison-container {
    max-width: 1100px;
    margin: 0 auto;
}

.comparison-box {
    border: 1px solid rgba(0, 102, 255, .2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.comparison-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

#comparison .data-table {
    background: transparent;
}

#comparison .data-table table {
    background-color: transparent;
}

#comparison .data-table thead th {
    color: #fff;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

#comparison .data-table tbody td {
    color: rgba(255, 255, 255, .88);
}

#comparison .data-table .table>:not(caption)>*>* {
    background: transparent;
}

/* Encoder phones image */
.encoder-phones {
    transform: translateX(-20%) scale(1.5);
    transform-origin: center;
}

/* Encoder canvas */
.encoder-canvas {
    background: #fff;
    border-radius: 12px;
    border: 4px solid rgba(255, 255, 255, .25);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
    padding: 12px;
}

.encoder-canvas-inner {
    position: relative;
    min-height: 320px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.encoder-prod {
    position: relative;
    z-index: 2;
    max-width: 86%;
    height: auto;
    transform: translateX(-6%) scale(1.05);
}

.encoder-ghost {
    position: absolute;
    left: 8%;
    top: 6%;
    z-index: 1;
    max-width: 74%;
    height: auto;
    opacity: .35;
    filter: grayscale(100%);
}

.encoder-canvas-logo {
    position: absolute;
    right: 16px;
    top: 12px;
    width: 52px;
    height: auto;
    z-index: 3;
}

.video-frame-white {
    background: #fff;
    border: 4px solid rgba(255, 255, 255, .25);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

/* Video section */
.video-col {
    position: relative;
    padding-left: 0;
    padding-right: 0;
}

.video-label-top {
    display: none;
}

.video-section-title {
    color: #fff;
    font-weight: 900;
    text-align: center;
    font-size: 22px;
    margin: 6px 0 18px;
}

.product-content-wide {
    width: 100%;
    padding: 0 16px;
    margin: 0;
}

.encoder-row {
    --bs-gutter-x: 1rem;
}

/* Variables & Action sections */
#variables {
    padding-top: 56px;
    align-items: flex-start;
}

#variables .container {
    margin-top: 16px;
}

.action-subtitle {
    color: rgba(255, 255, 255, .7);
    text-align: center;
}

.action-carousel {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.action-note {
    color: rgba(255, 255, 255, .6);
    font-style: italic;
}

/* Carousel controls */
#action .carousel-control-prev,
#action .carousel-control-next {
    width: 44px;
    height: 44px;
    background-color: var(--primary-blue);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
}

#action .carousel-control-prev {
    left: -64px;
}

#action .carousel-control-next {
    right: -64px;
}

#action .carousel-control-prev-icon,
#action .carousel-control-next-icon {
    display: none;
}

#action .carousel-control-prev::after {
    content: '\2039';
    color: #fff;
    font-size: 22px;
    line-height: 44px;
    display: block;
    text-align: center;
}

#action .carousel-control-next::after {
    content: '\203A';
    color: #fff;
    font-size: 22px;
    line-height: 44px;
    display: block;
    text-align: center;
}

.carousel-control-prev,
.carousel-control-next {
    z-index: 2;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6));
}

/* ===== Desktop (>= 900px) ===== */
@media (min-width: 900px) {
    .info-card .encoder-title {
        font-size: 25px;
    }

    #video .info-card .intro-text {
        font-size: 0.8rem;
    }

    .variables-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    #comparison .section-title {
        font-size: 30px;
    }

    .video-section-title {
        font-size: 26px;
        margin-bottom: 24px;
    }
}

/* Tablet (600px) */
@media (min-width: 600px) {
    .variables-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small screens */
@media (max-width: 899px) {
    .video-frame.video-large {
        transform: none;
    }

    #video .product-content {
        transform: translateY(-6%);
    }

    .encoder-phones {
        transform: translateX(0) scale(1.25);
    }

    .encoder-row {
        --bs-gutter-x: .75rem;
    }

    .encoder-prod {
        max-width: 92%;
        transform: translateX(-2%) scale(1.02);
    }

    .encoder-ghost {
        left: 6%;
        top: 8%;
        max-width: 80%;
        opacity: .28;
    }
}

@media (min-width: 1200px) {
    .encoder-canvas-inner {
        min-height: 380px;
    }
}

@media (max-width: 900px) {
    #action .carousel-control-prev {
        left: -40px;
    }

    #action .carousel-control-next {
        right: -40px;
    }
}

@media (max-width: 599px) {
    #comparison.info-section {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 72px 16px 32px;
    }

    #comparison .scroll-indicator {
        display: none;
    }

    #variables.info-section {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 72px 16px 32px;
    }

    #variables .scroll-indicator {
        display: none;
    }

    #action.info-section {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 72px 16px 32px;
    }

    #action .scroll-indicator {
        display: none;
    }

    .video-frame {
        margin-bottom: 12px;
    }

    #action .video-frame {
        width: 86%;
        margin: 0 auto;
    }
}

/* Medium desktop (900-1100px) */
@media (min-width: 900px) and (max-width: 1100px) {
    .header-encoder .desktop-nav {
        display: none;
    }

    .header-encoder .mobile-menu-btn {
        display: block;
        color: var(--text-white);
        font-size: 24px;
    }
}

/* ==========================================================
   REELS / VERTICAL VIDEO CAROUSEL
   ========================================================== */
.social-section {
    padding: 80px 0 60px;
    text-align: center;
}
.social-section .section-subtitle {
    font-size: 17px;
    color: var(--text-gray, #aaa);
    margin-bottom: 40px;
}

.reels-carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
}

.reels-track-outer {
    overflow: hidden;
    flex: 1;
    max-width: 960px;
}

.reels-track {
    display: flex;
    gap: 20px;
    transition: transform .45s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

/* 9:16 card */
.reel-card {
    flex: 0 0 calc(33.333% - 14px);
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #111;
    aspect-ratio: 9 / 16;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.08);
    transition: transform .25s, box-shadow .25s;
}
.reel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,102,255,.35);
}
.reel-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reel-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: .5px;
    z-index: 2;
}
.reel-badge .fab { font-size: 13px; }

.reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 14px 16px;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 2;
}
.reel-label {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.reel-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.8);
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, transform .2s;
    padding: 0;
}
.reel-play-btn:hover { background: rgba(0,102,255,.7); transform: scale(1.1); }

.reels-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.06);
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.reels-btn:hover { background: rgba(0,102,255,.5); }
.reels-btn:disabled { opacity: .3; cursor: default; }

.reels-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.reel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    transition: background .3s, transform .3s;
}
.reel-dot.active {
    background: #0066FF;
    transform: scale(1.3);
}

/* Mobile: 1 card */
@media (max-width: 767px) {
    .social-section { padding: 60px 0 40px; }
    .reels-carousel-wrapper { gap: 8px; padding: 0 4px; }
    .reels-track-outer { max-width: 100%; }
    .reels-track { gap: 12px; }
    .reel-card { flex: 0 0 82vw; max-width: 320px; }
    .reels-btn { width: 36px; height: 36px; font-size: 14px; }
    .reel-label { font-size: 13px; }
}

/* Tablet: 2 cards */
@media (min-width: 768px) and (max-width: 1023px) {
    .reel-card { flex: 0 0 calc(50% - 10px); }
}

/* Estado activo: borde azul cuando hay audio */
.reel-card.reel-active {
    box-shadow: 0 0 0 3px #0066FF, 0 16px 48px rgba(0,102,255,.4);
    border-color: #0066FF;
}

/* ==========================================================
   VIDEO MODAL FULLSCREEN
   ========================================================== */
.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.96);
    align-items: center;
    justify-content: center;
}
.video-modal.open {
    display: flex;
}
.video-modal-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.video-modal-inner video {
    /* portrait: fill height; landscape: fill width */
    max-height: 100dvh;
    max-width: 100dvw;
    width: auto;
    height: 100dvh;
    object-fit: contain;
    background: #000;
}
.video-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
.video-modal-close:hover { background: rgba(255,255,255,.3); }
