/* ==================================================
   Modern News Ticker - Estilos con Borde Configurable
   ================================================== */

/* Estilo base del contenedor de la marquesina */
.modern-news-ticker {
    position: relative;
    width: 100%;
    height: 70px;
    line-height: 60px;
    font-size: 18px;
    overflow: hidden;
    background-color: #000000;
    color: #ffffff;
    font-family: 'Barlow Condensed', 'Arial', sans-serif;
    margin: 20px 0;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Contenedor interno que maneja el desplazamiento */
.modern-news-ticker .ticker-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Reset de estilos para listas */
.modern-news-ticker ul,
.modern-news-ticker li {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline;
}

/* Lista de noticias - Contenedor de desplazamiento */
.modern-news-ticker ul {
    position: absolute;
    height: 100%;
    white-space: nowrap;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

/* Elemento de la noticia individual */
.modern-news-ticker li {
    display: inline-block;
    padding: 0 15px;
    height: 100%;
    line-height: 70px;
    vertical-align: top;
    border: 2px solid transparent;
    border-radius: 4px;
    margin: 0 5px;
    transition: border-color 0.3s ease;
}

/* Estilo del enlace */
.modern-news-ticker a {
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    color: #ffffff;
    display: flex;
    align-items: center;
    height: 100%;
    transition: opacity 0.3s ease;
}

.modern-news-ticker a:hover {
    opacity: 0.8;
}

/* Contenedor de la imagen/miniatura */
.modern-news-ticker .thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    vertical-align: middle;
}

/* Título del titular */
.modern-news-ticker .title {
    display: inline-block;
    vertical-align: middle;
    padding-right: 15px;
    font-size: 1.1em;
}

/* Mensajes de estado (Cargando/Error) */
.modern-news-ticker .loading-message,
.modern-news-ticker .error-message {
    display: block;
    padding-left: 15px;
    font-size: 1em;
    font-weight: 300;
}
.modern-news-ticker .error-message {
    color: #ff5555;
    font-weight: bold;
}

/* ==================================================
   NUEVOS ESTILOS (Título, Separador, Navegación)
   ================================================== */

/* Estilo para el Título de la Marquesina - SIN ESPACIO CON NOTICIAS */
.modern-news-ticker .ticker-title {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: #333;
    color: #fff;
    padding: 0 12px; /* Reducido para eliminar espacio */
    font-weight: bold;
    z-index: 10;
    text-transform: uppercase;
    line-height: 70px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0% 100%); /* Ángulo más cerrado */
    padding-right: 20px; /* Reducido para eliminar espacio */
    font-size: 16px;
    letter-spacing: 1px;
    min-width: 100px; /* Ancho más compacto */
    box-sizing: border-box;
    margin: 0; /* Eliminar cualquier margen */
}

/* Estilo para el separador entre noticias - MEJORADO PARA VISIBILIDAD */
.modern-news-ticker .ticker-separator {
    color: inherit;
    opacity: 0.8;
    font-weight: bold;
    margin: 0 8px 0 10px; /* Reducido margen */
    display: inline-block;
    font-size: 1.2em;
    vertical-align: middle;
    line-height: 70px;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Estilo para los botones de navegación */
.modern-news-ticker .ticker-controls {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    background: inherit;
    padding-left: 0; /* Eliminado padding */
    background-color: inherit;
    margin: 0; /* Eliminar margen */
}

.modern-news-ticker .ticker-controls button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 18px; /* Reducido tamaño */
    height: 100%;
    width: 35px; /* Reducido ancho */
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0; /* Eliminar margen */
    padding: 0; /* Eliminar padding */
}

.modern-news-ticker .ticker-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Estilo para el caso de fallo de imagen */
.modern-news-ticker .thumbnail.error-loaded {
    object-fit: contain;
    background-color: transparent;
    padding: 5px;
}

/* ==================================================
   MEDIA QUERIES MEJORADAS PARA RESPONSIVIDAD
   ================================================== */

/* PANTALLAS GRANDES (Desktop) - SIN ESPACIO ENTRE TÍTULO Y NOTICIAS */
@media (min-width: 1025px) {
    .modern-news-ticker .ticker-title {
        min-width: 90px; /* Mínimo espacio necesario */
        padding: 0 10px;
        padding-right: 18px;
        font-size: 15px; /* Texto ligeramente más pequeño */
        clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0% 100%); /* Ángulo mínimo */
    }
    
    .modern-news-ticker .ticker-wrapper {
        left: 95px !important; /* Espacio mínimo para el título */
        width: calc(100% - 95px) !important; /* Máximo espacio para noticias */
    }
    
    .modern-news-ticker .ticker-wrapper.has-controls {
        width: calc(100% - 95px - 70px) !important; /* Con botones de navegación */
    }
    
    .modern-news-ticker .ticker-controls button {
        width: 32px;
        font-size: 16px;
    }
}

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .modern-news-ticker {
        height: 65px;
        line-height: 55px;
        font-size: 17px;
    }
    
    .modern-news-ticker .ticker-title {
        font-size: 14px;
        padding: 0 8px;
        padding-right: 16px;
        min-width: 80px;
        line-height: 65px;
        clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0% 100%);
    }
    
    .modern-news-ticker .thumbnail {
        width: 55px;
        height: 55px;
        margin-right: 8px;
    }
    
    .modern-news-ticker li {
        line-height: 65px;
        padding: 0 10px;
    }
    
    .modern-news-ticker .ticker-controls button {
        line-height: 65px;
        font-size: 16px;
        width: 30px;
    }
    
    .modern-news-ticker .ticker-separator {
        margin: 0 6px 0 8px;
        font-size: 1.1em;
        line-height: 65px;
    }
    
    /* Ajustar ancho del wrapper para tablets - MÍNIMO ESPACIO */
    .modern-news-ticker .ticker-wrapper {
        left: 85px !important;
        width: calc(100% - 85px) !important;
    }
    
    .modern-news-ticker .ticker-wrapper.has-controls {
        width: calc(100% - 85px - 60px) !important;
    }
}

/* Móviles y pantallas pequeñas - MÁXIMA COMPACTACIÓN */
@media (max-width: 768px) {
    .modern-news-ticker {
        height: 55px;
        line-height: 45px;
        font-size: 15px;
        margin: 15px 0;
    }
    
    /* TÍTULO MÁXIMAMENTE COMPACTO */
    .modern-news-ticker .ticker-title {
        font-size: 12px;
        padding: 0 6px;
        padding-right: 14px;
        min-width: 65px;
        line-height: 55px;
        clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0% 100%);
        letter-spacing: 0.3px;
    }
    
    /* IMÁGENES MÁS PEQUEÑAS */
    .modern-news-ticker .thumbnail {
        width: 40px;
        height: 40px;
        margin-right: 5px;
    }
    
    /* ELEMENTOS DE LISTA MÁXIMAMENTE COMPACTOS */
    .modern-news-ticker li {
        line-height: 55px;
        padding: 0 6px;
        margin: 0 2px;
    }
    
    /* BOTONES DE NAVEGACIÓN MÍNIMOS */
    .modern-news-ticker .ticker-controls button {
        line-height: 55px;
        font-size: 14px;
        width: 25px;
    }
    
    /* SEPARADOR MÍNIMO */
    .modern-news-ticker .ticker-separator {
        margin: 0 4px 0 5px;
        font-size: 0.9em;
        line-height: 55px;
    }
    
    /* MÁXIMA OPTIMIZACIÓN DE ESPACIO */
    .modern-news-ticker .ticker-wrapper {
        left: 68px !important;
        width: calc(100% - 68px) !important;
    }
    
    .modern-news-ticker .ticker-wrapper.has-controls {
        width: calc(100% - 68px - 50px) !important;
    }
    
    /* Reducir padding interno del título en noticias */
    .modern-news-ticker .title {
        padding-right: 5px;
    }
}

/* Móviles muy pequeños (menos de 480px) - OPTIMIZACIÓN EXTREMA */
@media (max-width: 480px) {
    .modern-news-ticker {
        height: 48px;
        line-height: 38px;
        font-size: 13px;
    }
    
    .modern-news-ticker .ticker-title {
        font-size: 11px;
        padding: 0 4px;
        padding-right: 12px;
        min-width: 55px;
        line-height: 48px;
    }
    
    .modern-news-ticker .thumbnail {
        width: 35px;
        height: 35px;
        margin-right: 3px;
    }
    
    .modern-news-ticker li {
        line-height: 48px;
        padding: 0 4px;
    }
    
    .modern-news-ticker .ticker-controls button {
        line-height: 48px;
        width: 22px;
        font-size: 12px;
    }
    
    .modern-news-ticker .ticker-separator {
        margin: 0 2px 0 3px;
        font-size: 0.8em;
        line-height: 48px;
    }
    
    /* OPTIMIZACIÓN EXTREMA DE ESPACIO */
    .modern-news-ticker .ticker-wrapper {
        left: 58px !important;
        width: calc(100% - 58px) !important;
    }
    
    .modern-news-ticker .ticker-wrapper.has-controls {
        width: calc(100% - 58px - 44px) !important;
    }
}

/* Modo ultra compacto para iframes pequeños */
@media (max-width: 320px) {
    .modern-news-ticker.ultra-compact {
        height: 42px;
        line-height: 32px;
        font-size: 12px;
    }
    
    .modern-news-ticker.ultra-compact .ticker-title {
        font-size: 10px;
        padding: 0 3px;
        min-width: 45px;
        line-height: 42px;
    }
    
    .modern-news-ticker.ultra-compact .thumbnail {
        display: none;
    }
    
    .modern-news-ticker.ultra-compact .ticker-wrapper {
        left: 48px !important;
        width: calc(100% - 48px) !important;
    }
}