/**
 * Elementor Timecode Clock Widget Styles
 * Layout fix amb posicions fixes per HH:MM:SS:FF
 */

/* Reset y base */
.timecode-clock-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: auto;
}

/* Display principal del reloj - LAYOUT FIX */
.timecode-clock-display {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 100;
    font-size: 4rem;
    color: #ffffff;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    position: relative;
}

/* Elements individuals - AMPLADA UNIFORME */
.timecode-clock-display .hours-display,
.timecode-clock-display .minutes-display,
.timecode-clock-display .seconds-display,
.timecode-clock-display .frames-display {
    display: inline-block;
    width: 2ch; /* MATEIXA AMPLADA per tots */
    font-size: 1em;
    font-weight: 100;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    text-shadow: inherit;
    text-align: center;
    position: relative;
}

/* Separadors - ESPAIAT UNIFORME */
.timecode-clock-display .separator {
    display: inline-block;
    width: 0.4ch; /* Una mica més ample per millor espaiat */
    font-size: 1em;
    font-weight: 100;
    text-shadow: inherit;
    text-align: center;
    position: relative;
    opacity: 0.9;
    margin: 0; /* Reset margin */
}

/* Eliminar tot l'espaiat personalitzat - MATEIX ESPAIAT */
.timecode-clock-display .hours-display + .separator,
.timecode-clock-display .minutes-display + .separator,
.timecode-clock-display .seconds-display + .separator {
    margin-left: 0;
    margin-right: 0;
}

/* Eliminar diferència per AM/PM - MATEIXA MIDA */
.timecode-clock-display .seconds-display {
    width: 2ch; /* MATEIXA mida que la resta */
}

/* Efecte Glitch - Estil CodePen millorat */
.timecode-clock-display.glitch {
    position: relative;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.timecode-clock-display.glitch::before,
.timecode-clock-display.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    background: transparent;
}

.timecode-clock-display.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.timecode-clock-display.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

/* Animació principal de glitch */
@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
        transform: skew(0.38deg);
    }
    5% {
        clip: rect(77px, 9999px, 81px, 0);
        transform: skew(0.97deg);
    }
    10% {
        clip: rect(95px, 9999px, 47px, 0);
        transform: skew(0.87deg);
    }
    15% {
        clip: rect(61px, 9999px, 99px, 0);
        transform: skew(0.69deg);
    }
    20% {
        clip: rect(52px, 9999px, 36px, 0);
        transform: skew(0.74deg);
    }
    25% {
        clip: rect(78px, 9999px, 23px, 0);
        transform: skew(0.42deg);
    }
    30% {
        clip: rect(22px, 9999px, 16px, 0);
        transform: skew(0.64deg);
    }
    35% {
        clip: rect(50px, 9999px, 68px, 0);
        transform: skew(0.21deg);
    }
    40% {
        clip: rect(16px, 9999px, 100px, 0);
        transform: skew(0.32deg);
    }
    45% {
        clip: rect(68px, 9999px, 55px, 0);
        transform: skew(0.96deg);
    }
    50% {
        clip: rect(83px, 9999px, 27px, 0);
        transform: skew(0.41deg);
    }
    55% {
        clip: rect(41px, 9999px, 72px, 0);
        transform: skew(0.88deg);
    }
    60% {
        clip: rect(19px, 9999px, 90px, 0);
        transform: skew(0.29deg);
    }
    65% {
        clip: rect(92px, 9999px, 13px, 0);
        transform: skew(0.77deg);
    }
    70% {
        clip: rect(34px, 9999px, 85px, 0);
        transform: skew(0.18deg);
    }
    75% {
        clip: rect(57px, 9999px, 44px, 0);
        transform: skew(0.52deg);
    }
    80% {
        clip: rect(73px, 9999px, 29px, 0);
        transform: skew(0.83deg);
    }
    85% {
        clip: rect(25px, 9999px, 76px, 0);
        transform: skew(0.35deg);
    }
    90% {
        clip: rect(88px, 9999px, 11px, 0);
        transform: skew(0.91deg);
    }
    95% {
        clip: rect(46px, 9999px, 62px, 0);
        transform: skew(0.26deg);
    }
    100% {
        clip: rect(70px, 9999px, 39px, 0);
        transform: skew(0.58deg);
    }
}

/* Animació secundària de glitch */
@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 119px, 0);
        transform: skew(0.62deg);
    }
    5% {
        clip: rect(29px, 9999px, 60px, 0);
        transform: skew(0.34deg);
    }
    10% {
        clip: rect(97px, 9999px, 20px, 0);
        transform: skew(0.81deg);
    }
    15% {
        clip: rect(42px, 9999px, 103px, 0);
        transform: skew(0.47deg);
    }
    20% {
        clip: rect(81px, 9999px, 7px, 0);
        transform: skew(0.93deg);
    }
    25% {
        clip: rect(14px, 9999px, 86px, 0);
        transform: skew(0.28deg);
    }
    30% {
        clip: rect(56px, 9999px, 38px, 0);
        transform: skew(0.71deg);
    }
    35% {
        clip: rect(91px, 9999px, 51px, 0);
        transform: skew(0.15deg);
    }
    40% {
        clip: rect(35px, 9999px, 75px, 0);
        transform: skew(0.89deg);
    }
    45% {
        clip: rect(63px, 9999px, 24px, 0);
        transform: skew(0.44deg);
    }
    50% {
        clip: rect(8px, 9999px, 112px, 0);
        transform: skew(0.67deg);
    }
    55% {
        clip: rect(74px, 9999px, 43px, 0);
        transform: skew(0.22deg);
    }
    60% {
        clip: rect(47px, 9999px, 95px, 0);
        transform: skew(0.56deg);
    }
    65% {
        clip: rect(18px, 9999px, 69px, 0);
        transform: skew(0.85deg);
    }
    70% {
        clip: rect(85px, 9999px, 31px, 0);
        transform: skew(0.39deg);
    }
    75% {
        clip: rect(53px, 9999px, 108px, 0);
        transform: skew(0.73deg);
    }
    80% {
        clip: rect(26px, 9999px, 58px, 0);
        transform: skew(0.19deg);
    }
    85% {
        clip: rect(99px, 9999px, 12px, 0);
        transform: skew(0.94deg);
    }
    90% {
        clip: rect(39px, 9999px, 82px, 0);
        transform: skew(0.51deg);
    }
    95% {
        clip: rect(71px, 9999px, 45px, 0);
        transform: skew(0.76deg);
    }
    100% {
        clip: rect(5px, 9999px, 101px, 0);
        transform: skew(0.33deg);
    }
}

/* Animació de skew per l'element principal */
@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }
    10% {
        transform: skew(-2deg);
    }
    20% {
        transform: skew(1deg);
    }
    30% {
        transform: skew(-1deg);
    }
    40% {
        transform: skew(2deg);
    }
    50% {
        transform: skew(-1deg);
    }
    60% {
        transform: skew(0deg);
    }
    70% {
        transform: skew(1deg);
    }
    80% {
        transform: skew(-2deg);
    }
    90% {
        transform: skew(1deg);
    }
    100% {
        transform: skew(0deg);
    }
}

/* Responsivitat mantenint el layout fix */
@media (max-width: 768px) {
    .timecode-clock-display {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .timecode-clock-display {
        font-size: 2.5rem;
    }
    
    .timecode-clock-display .hours-display,
    .timecode-clock-display .minutes-display,
    .timecode-clock-display .frames-display {
        width: 1.8ch;
    }
    
    .timecode-clock-display .separator {
        width: 0.25ch;
    }
}

@media (max-width: 320px) {
    .timecode-clock-display {
        font-size: 2rem;
    }
    
    .timecode-clock-display .hours-display,
    .timecode-clock-display .minutes-display,
    .timecode-clock-display .frames-display {
        width: 1.6ch;
    }
    
    .timecode-clock-display .separator {
        width: 0.2ch;
    }
}

/* Mejor de accesibilitat */
@media (prefers-reduced-motion: reduce) {
    .timecode-clock-display,
    .timecode-clock-display .separator {
        animation: none !important;
        transition: none !important;
    }
}

/* Suport per a pantalles d'alta densitat */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .timecode-clock-display {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Estats de càrrega */
.timecode-clock-display:not([data-timecode-clock-initialized]) {
    opacity: 0.6;
}

.timecode-clock-display[data-timecode-clock-initialized] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Optimitzacions de rendiment */
.timecode-clock-display {
    will-change: transform;
    transform: translateZ(0);
}

/* Suport per a fonts web */
@supports (font-variation-settings: normal) {
    .timecode-clock-display {
        font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
        font-variation-settings: 'wght' 100;
    }
}

/**
 * ==========================================
 * TV-elements Video Frame Widget
 * ==========================================
 */

/* Contenidor principal */
.tv-video-frame-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: visible !important;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wrapper del vídeo */
.tv-video-frame-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Shadow box - contenidor intermedi per l'ombra */
.tv-video-frame-shadow-box {
    position: relative;
    display: block;
    width: fit-content;
    height: fit-content;
    line-height: 0;
    pointer-events: auto;
}

/* Vídeo - element principal */
.tv-video-frame-video {
    display: block;
    width: 800px;
    height: auto;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

/* Overlay del marc */
.tv-video-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imatge del marc */
.tv-video-frame-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Error message */
.tv-video-frame-error {
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .tv-video-frame-container {
        height: 400px;
    }

    .tv-video-frame-video {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tv-video-frame-container {
        height: 250px;
    }
}

/* ===========================
   EscriberTV Widget Styles
   =========================== */

.tv-escribir-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    flex-wrap: wrap;
}

.tv-escribir-text {
    position: relative;
    display: block;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.6;
    width: 100%;
    text-align: center;
}

/* Placeholder - ocult però reserva l'espai */
.tv-escribir-placeholder {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    position: absolute;
    white-space: normal;
    word-wrap: break-word;
}

/* Div visible - es va mostrant el text */
.tv-escribir-visible {
    position: relative;
    display: inline-block;
    width: 100%;
}

.tv-escribir-part {
    display: inline;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.tv-escribir-text br {
    display: block;
    content: '';
}

.tv-escribir-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: currentColor;
    margin-left: 2px;
    animation: tv-escribir-blink 0.7s infinite;
    vertical-align: text-top;
}

@keyframes tv-escribir-blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* ============================================
   VIDEO LIGHTBOX WIDGET
   ============================================ */

/* Wrapper del lightbox */
.tv-video-lightbox-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

/* Poster amb imatge */
.tv-video-poster {
    position: relative;
    display: inline-block;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease;
    max-width: 100%;
}

.tv-video-poster:hover {
    transform: scale(1.02);
}

.tv-video-poster img {
    display: block;
    width: 100%;
    height: auto;
}

/* Botó de play personalitzable */
.tv-video-play-button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tv-video-play-button svg {
    display: block;
}

/* Hover overlay amb informació */
.tv-poster-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.tv-video-poster:hover .tv-poster-hover-overlay {
    opacity: 1;
}

/* Mostrar info del poster sempre en tablets i mòbils */
@media (max-width: 1024px) {
    .tv-poster-hover-overlay {
        opacity: 1 !important;
    }
}

.tv-poster-info {
    text-align: center;
    z-index: 3;
}

.tv-poster-info-title {
    margin-bottom: 10px;
    display: inline-block;
}

.tv-poster-info-title.has-background {
    padding: 10px 20px;
}

.tv-poster-info-client {
    margin-bottom: 5px;
}

.tv-poster-info-duration {
    margin-top: 5px;
}

/* ===== VIDEO LIGHTBOX ===== */

/* Overlay del lightbox */
.tv-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.tv-lightbox-overlay.active {
    display: flex;
}

/* Botó tancar */
.tv-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 10001;
}

.tv-lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tv-lightbox-close svg {
    width: 20px;
    height: 20px;
}

/* Contenidor del lightbox */
.tv-lightbox-content {
    position: relative;
    width: auto !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    display: flex;
    align-items: center;
}

.tv-lightbox-content.logo-top {
    flex-direction: column;
}

.tv-lightbox-content.logo-bottom {
    flex-direction: column-reverse;
}

/* Logotip */
.tv-lightbox-logo {
    width: 100%;
    text-align: center;
}

.tv-lightbox-logo.align-left {
    text-align: left;
}

.tv-lightbox-logo.align-right {
    text-align: right;
}

.tv-lightbox-logo img {
    max-width: 100%;
    height: auto;
}

/* Contenidor del vídeo */
.tv-lightbox-video-wrapper {
    position: relative !important;
    width: 100% !important;
    min-width: 800px !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    border-radius: 20px !important;
}

.tv-lightbox-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 20px !important;
}

/* ============================================
   iFrame Mandanga Widget
   ============================================ */

.tv-iframe-wrapper {
    display: block;
    width: 100%;
}

.tv-iframe-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: inline-block;
}

.tv-iframe-container iframe {
    width: 100%;
    display: block;
    border: none;
}

.tv-iframe-aspect-ratio {
    height: 0;
    padding-bottom: 0 !important;
}

.tv-iframe-aspect-ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tv-iframe-click-blocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: default;
}

/* ============================================
   Mandanga Idiomes Widget
   ============================================ */

/* Mandanga Idiomes */
.mandanga-idiomes-container {
    position: fixed !important;
    z-index: 9999;
    top: var(--mandanga-top-offset, 0px) !important;
}

.mandanga-idiomes-position-left .mandanga-idiomes-container {
    left: var(--mandanga-horizontal-offset, 20px);
    right: auto;
}

.mandanga-idiomes-position-right .mandanga-idiomes-container {
    right: var(--mandanga-horizontal-offset, 20px);
    left: auto;
}

/* Estructura general del selector */
.mandanga-idiomes-wrapper {
    position: relative;
    width: 220px;
    height: calc(var(--mandanga-globe-size, 60px) + 160px);
    display: block;
    --mandanga-drop: 0px;
    --mandanga-side-offset: 85px;
    --mandanga-side-y: calc(var(--mandanga-globe-size, 60px) * 0.6 + 10px);
    --mandanga-bottom-y: calc(var(--mandanga-globe-size, 60px) + 80px);
}

.mandanga-idiomes-wrapper::before {
    content: '';
    position: absolute;
    top: calc(-1 * var(--mandanga-top-offset, 0px));
    left: 50%;
    width: 14px;
    height: calc(var(--mandanga-top-offset, 0px) + var(--mandanga-drop, 0px));
    background: var(--mandanga-strap-color, var(--mandanga-globe-bg, rgba(0, 0, 0, 0.35)));
    transform: translateX(-50%);
    transition: height 0.25s ease, background 0.2s ease, opacity 0.2s ease;
    border-radius: 0 0 8px 8px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.8;
}

.mandanga-idiomes-wrapper.mandanga-open {
    --mandanga-drop: 0px;
}

.mandanga-idiomes-globe {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, 0);
    width: calc(var(--mandanga-globe-size, 60px) * 1.2);
    height: var(--mandanga-globe-size, 60px);
    border-radius: 0 0 999px 999px !important;
    --mandanga-globe-bg: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.3s ease, opacity 0.2s ease;
    z-index: 2;
    opacity: 0.8;
}

.mandanga-idiomes-wrapper.mandanga-open .mandanga-idiomes-globe {
    transform: translate(-50%, 0) scale(1.05) !important;
    opacity: 1;
}

.mandanga-idiomes-globe svg {
    display: block;
    width: calc(var(--mandanga-globe-size, 60px) * 0.55);
    height: calc(var(--mandanga-globe-size, 60px) * 0.55);
}

.mandanga-idiomes-options {
    position: absolute;
    inset: calc(var(--mandanga-globe-size, 60px) * -0.2) -120px -140px;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.25s ease;
    pointer-events: none;
    transition-delay: 0s, 0s, 0s;
}

.mandanga-idiomes-wrapper.mandanga-open .mandanga-idiomes-options,
.mandanga-idiomes-options:focus-within {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0.3s, 0.3s, 0s;
}

.mandanga-idiomes-option {
    position: absolute;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    min-width: 90px;
}

/* 1 idioma: sota */
.mandanga-idiomes-count-1 .mandanga-idiomes-option:nth-child(1) {
    top: var(--mandanga-bottom-y);
    left: 50%;
}

/* 2 idiomes: costats */
.mandanga-idiomes-count-2 .mandanga-idiomes-option:nth-child(1) {
    top: var(--mandanga-side-y);
    left: calc(50% - var(--mandanga-side-offset));
}

.mandanga-idiomes-count-2 .mandanga-idiomes-option:nth-child(2) {
    top: var(--mandanga-side-y);
    left: calc(50% + var(--mandanga-side-offset));
}

/* 3 idiomes: costats + sota */
.mandanga-idiomes-count-3 .mandanga-idiomes-option:nth-child(1) {
    top: var(--mandanga-side-y);
    left: calc(50% - var(--mandanga-side-offset));
}

.mandanga-idiomes-count-3 .mandanga-idiomes-option:nth-child(2) {
    top: var(--mandanga-side-y);
    left: calc(50% + var(--mandanga-side-offset));
}

.mandanga-idiomes-count-3 .mandanga-idiomes-option:nth-child(3) {
    top: var(--mandanga-bottom-y);
    left: 50%;
}

@media (max-width: 767px) {
    .mandanga-idiomes-wrapper {
        width: 180px;
        --mandanga-side-offset: 70px;
        --mandanga-side-y: calc(var(--mandanga-globe-size, 60px) * 0.65 + 15px);
        --mandanga-bottom-y: calc(var(--mandanga-globe-size, 60px) + 70px);
    }
}

/* ============================================
   Fitxa Mandanga Widget
   ============================================ */

.tv-fitxa-wrapper {
    width: 100%;
    perspective: 1000px;
}

.tv-fitxa-container {
    position: relative;
    width: 100%;
    height: 400px;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.tv-fitxa-container.flipped {
    transform: rotateY(180deg);
}

.tv-fitxa-front,
.tv-fitxa-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.tv-fitxa-front::before,
.tv-fitxa-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    background-size: cover;
    background-position: center;
    opacity: 0;
    pointer-events: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
    z-index: 0;
}

.tv-fitxa-container:hover .tv-fitxa-front::before {
    filter: blur(8px);
    opacity: 1;
}

.tv-fitxa-front {
    transform: rotateY(0deg);
}

.tv-fitxa-back {
    transform: rotateY(180deg);
}

.tv-fitxa-front-content,
.tv-fitxa-back-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.tv-fitxa-front-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.tv-fitxa-container:hover .tv-fitxa-front-hover-overlay {
    opacity: 0.6;
}

.tv-fitxa-title {
    margin: 0;
    text-align: center;
    z-index: 2;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tv-fitxa-container:hover .tv-fitxa-title {
    opacity: 1;
    transform: scale(1);
}

/* Mostrar títol sempre en tablets i mòbils */
@media (max-width: 1024px) {
    .tv-fitxa-title {
        opacity: 1 !important;
        transform: scale(1) !important;
    }
    
    .tv-fitxa-front-hover-overlay {
        opacity: 0.6 !important;
    }
    
    .tv-fitxa-icon {
        transform: translateY(var(--icon-move-distance, -20px)) !important;
    }
    
    .tv-fitxa-container:hover .tv-fitxa-front::before {
        filter: none !important;
        opacity: 0 !important;
    }
}

.tv-fitxa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.3s ease;
}

.tv-fitxa-container:hover .tv-fitxa-icon {
    transform: translateY(var(--icon-move-distance, -20px));
}

.tv-fitxa-back-content {
    overflow-y: auto;
    text-align: center;
}

.tv-fitxa-back-content::-webkit-scrollbar {
    width: 6px;
}

.tv-fitxa-back-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.tv-fitxa-back-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.tv-fitxa-back-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .tv-lightbox-video-wrapper {
        min-width: 100% !important;
    }
    
    .tv-lightbox-video {
        min-height: 300px !important;
    }
}

/* Controls */
.tv-lightbox-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.tv-lightbox-controls.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.tv-lightbox-controls.bottom {
    margin-top: 20px;
}

.tv-lightbox-control-btn {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tv-lightbox-control-btn:hover {
    transform: scale(1.1);
}

.tv-lightbox-control-btn svg {
    width: 60%;
    height: 60%;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .tv-lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .tv-lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .tv-lightbox-controls {
        gap: 8px;
    }
}

/* =========================================
 * Logo Grid
 * Inspirat en Happy Addons Logo Grid
 * =======================================*/
.tv-logo-grid-wrapper {
    width: 100%;
}

.tv-logo-grid {
    display: grid;
    grid-template-columns: repeat(var(--tv-logo-columns, 4), minmax(0, 1fr));
    gap: var(--tv-logo-gap, 20px);
    justify-items: center;
    align-items: center;
}

.tv-logo-grid.is-masonry {
    display: block;
    column-count: var(--tv-logo-columns, 4);
    column-gap: var(--tv-logo-gap, 20px);
}

.tv-logo-grid-item {
    display: flex;
    align-items: center;
    justify-content: center;
    --logo-scale: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tv-logo-grid.is-masonry .tv-logo-grid-item {
    break-inside: avoid;
    width: 100%;
    margin-bottom: var(--tv-logo-gap, 20px);
}

.tv-logo-grid-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: scale(var(--logo-scale, 1));
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.tv-logo-grid-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tv-logo-grid.has-grayscale img {
    filter: grayscale(100%);
    opacity: 0.85;
}

.tv-logo-grid.has-grayscale img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

.tv-logo-grid.hover-scale .tv-logo-grid-item:hover img {
    transform: scale(calc(var(--logo-scale, 1) * 1.05));
}

.tv-logo-grid.hover-lift .tv-logo-grid-item:hover img {
    transform: translateY(-6px) scale(var(--logo-scale, 1));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.tv-logo-grid.has-reveal .tv-logo-grid-item {
    opacity: 0;
    transform: translateX(-12px);
}

.tv-logo-grid.has-reveal .tv-logo-grid-item.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* =========================================
 * Mandanga Team Widget
 * =======================================*/
.mandanga-team-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #0e0e11;
    border-radius: 16px;
    padding: 20px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mandanga-team-card.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

.mandanga-team-photo {
    width: 100%;
    height: 320px;
    position: relative;
    overflow: hidden;
}

.mandanga-team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    transition: transform 0.35s ease;
}

.mandanga-team-card.hover-overlay .mandanga-team-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.mandanga-team-card.hover-overlay:hover .mandanga-team-photo::after {
    opacity: 1;
}

.mandanga-team-card.hover-overlay:hover .mandanga-team-photo img {
    transform: scale(1.04);
}

.mandanga-team-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mandanga-team-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.mandanga-team-role {
    font-size: 0.95rem;
    font-weight: 500;
    color: #c7c7c7;
}

.mandanga-team-bio {
    margin-top: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #d9d9d9;
}

.mandanga-team-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.mandanga-team-social a {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.mandanga-team-social a:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
    color: #f8cb2e;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.mandanga-team-card.hover-none:hover {
    transform: none;
    box-shadow: none;
}
