/* =========================================================================
   TuNoticia Mundial Widget — Frontend CSS
   Estilos encapsulados para no interferir con el resto del sitio.
   ========================================================================= */

.mpw-widget {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    width: 100%;
    margin: 1.5rem auto;
    padding: 0;
    clear: both;
}

.mpw-widget *,
.mpw-widget *::before,
.mpw-widget *::after {
    box-sizing: inherit;
}

/* ──── HEADER DEL WIDGET ──── */
.mpw-widget-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 2px solid #3d3d3d;
    margin-bottom: 16px;
    background: transparent;
}

.mpw-logo-img {
    height: 54px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* ──── CONTENEDOR TRACK (SLIDER) ──── */
.mpw-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 16px;
    scrollbar-width: thin;
    scrollbar-color: #555555 transparent;
    align-items: stretch;
}

.mpw-track::-webkit-scrollbar {
    height: 6px;
}

.mpw-track::-webkit-scrollbar-track {
    background: transparent;
}

.mpw-track::-webkit-scrollbar-thumb {
    background: #555555;
    border-radius: 10px;
}

/* ──── TARJETA DE PARTIDO (COLOR #2d2d2d POR DEFECTO) ──── */
.mpw-card {
    flex: 0 0 260px;
    min-width: 260px;
    background: #2d2d2d;
    color: #ffffff;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #3d3d3d;
}

.mpw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Columna izquierda: Fecha y Sede */
.mpw-card-col-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.mpw-date-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mpw-icon-calendar {
    width: 14px;
    height: 14px;
    color: #e2e8f0;
    flex-shrink: 0;
}

.mpw-date-time {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.mpw-date-day {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mpw-time-val {
    font-size: 12px;
    font-weight: 400;
    color: #cbd5e1;
}

.mpw-stadium-row {
    font-size: 10px;
    color: #a0aec0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Columna derecha: Equipos y Marcadores */
.mpw-card-col-right {
    flex: 0 0 110px;
    width: 110px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 1px solid #4a5568;
    padding-left: 12px;
}

.mpw-team-row {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.mpw-flag {
    width: 18px;
    height: 18px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #4a5568;
    flex-shrink: 0;
}

.mpw-team-code {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

.mpw-team-score {
    margin-left: auto;
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
    min-width: 12px;
    text-align: right;
}

/* ──── SEPARADOR DE FECHA VERTICAL ──── */
.mpw-separator {
    width: 1px;
    background: #4a5568;
    align-self: stretch;
    margin: 4px 8px;
    flex-shrink: 0;
}

/* ──── ESTADOS ──── */
.mpw-card--live {
    border-color: #e53e3e;
}
.mpw-card--live::after {
    content: "● LIVE";
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 8px;
    font-weight: bold;
    color: #e53e3e;
    letter-spacing: 0.5px;
}

/* ──── FORMATO VERTICAL (SIDEBAR) ──── */
.mpw-widget--vertical .mpw-track {
    flex-direction: column;
    overflow-x: visible;
}

.mpw-widget--vertical .mpw-card {
    flex: 1 1 auto;
    width: 100%;
}

.mpw-widget--vertical .mpw-separator {
    width: 100%;
    height: 1px;
    margin: 8px 0;
}

/* ──── TEMA CLARO (Compatibilidad opcional, pero mantiene el color premium #2d2d2d en tarjetas) ──── */
.mpw-widget--claro .mpw-widget-header {
    border-bottom-color: #cbd5e1;
}

.mpw-widget--claro .mpw-separator {
    background: #cbd5e1;
}

/* ──── HEADER FILTERS ──── */
.mpw-widget-header {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.mpw-header-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mpw-btn-filter {
    background: #1a1a1a;
    color: #a0aec0;
    border: 1px solid #3d3d3d;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mpw-btn-filter:hover {
    background: #2d2d2d;
    color: #ffffff;
}

.mpw-btn-filter.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

/* ──── CARD HOVER / CLICK ──── */
.mpw-card {
    cursor: pointer;
}

/* ──── MODAL OVERLAY ──── */
.mpw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpw-modal-container {
    background: #2d2d2d;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    border: 1px solid #3d3d3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    color: #ffffff;
    overflow: hidden;
    font-family: inherit;
    animation: mpwModalFadeIn 0.3s ease;
}

@keyframes mpwModalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.mpw-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 10;
}

.mpw-modal-close:hover {
    color: #ffffff;
}

/* ──── MODAL CONTENT ──── */
.mpw-modal-content {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #555555 transparent;
}

.mpw-modal-content::-webkit-scrollbar {
    width: 6px;
}
.mpw-modal-content::-webkit-scrollbar-thumb {
    background: #555555;
    border-radius: 10px;
}

.mpw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3d3d3d;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.mpw-modal-team {
    text-align: center;
    flex: 1;
}

.mpw-modal-team h2 {
    font-size: 14px;
    margin: 8px 0 0;
    font-weight: 700;
}

.mpw-modal-flag {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #4a5568;
}

.mpw-modal-score {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    padding: 0 16px;
}

.mpw-modal-score small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #a0aec0;
    margin-top: 4px;
}

/* ──── MODAL TIMELINE ──── */
.mpw-modal-timeline h3 {
    font-size: 14px;
    margin: 0 0 16px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.mpw-timeline-wrapper {
    position: relative;
    padding: 10px 0;
}

.mpw-timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #4a5568;
    transform: translateX(-50%);
}

.mpw-tl-item {
    position: relative;
    margin-bottom: 16px;
    width: 50%;
    box-sizing: border-box;
}

.mpw-tl-item::after {
    content: '';
    position: absolute;
    top: 4px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #2d2d2d;
}

.mpw-tl-left {
    padding-right: 20px;
    text-align: right;
    left: 0;
}
.mpw-tl-left::after {
    right: -6px;
}

.mpw-tl-right {
    padding-left: 20px;
    text-align: left;
    left: 50%;
}
.mpw-tl-right::after {
    left: -6px;
}

.mpw-tl-min {
    font-weight: 800;
    font-size: 13px;
    color: #cbd5e1;
    display: block;
}

.mpw-tl-player {
    font-size: 12px;
    color: #ffffff;
}

.mpw-modal-empty {
    text-align: center;
    color: #718096;
    font-size: 13px;
    font-style: italic;
}
