/* ==========================================
   COMET API READER - MAIN STYLES (v17 - General)
========================================== */

.comet-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111827;
    font-size: 14px;
    width: 100%;
    margin: 0 auto 2rem auto;
}

.comet-error { color: #dc2626; background: #fee2e2; padding: 1rem; text-align: center; font-weight: 500; }
.comet-empty-state { padding: 1.5rem; background: #f9fafb; border: 1px solid #e5e7eb; text-align: center; color: #6b7280; border-radius: 12px; }
.comet-table-responsive { overflow-x: auto; background: #ffffff; }
.comet-escudo { width: 24px; height: auto; vertical-align: middle; }

/* TABLAS GENERALES */
.comet-table-clean { width: 100%; border-collapse: collapse; text-align: left; }
.comet-table-clean th { background-color: #f9fafb; color: #6b7280; font-size: 12px; font-weight: 600; text-transform: uppercase; padding: 12px 16px; border-bottom: 1px solid #e5e7eb; }
.comet-table-clean td { padding: 12px 16px; border-bottom: 1px solid #e5e7eb; vertical-align: middle; }
.comet-table-clean tbody tr:last-child td { border-bottom: 1px solid #e5e7eb; }
.comet-table-clean tbody tr:hover { background-color: #f9fafb; }

.comet-cell-center { text-align: center; }
.comet-cell-rank { color: #6b7280; font-weight: 600; }
.comet-team-name { 
    font-weight: 600; 
    color: #111827; 
    margin-left: 8px; 
    padding-right: 30px; 
    display: inline-block; 
    vertical-align: middle;
    white-space: nowrap; 
}
.comet-cell-pts { font-weight: 700; color: #111827; }

/* TOOLTIPS */
.comet-tooltip { position: relative; display: inline-block; cursor: help; }
.comet-tooltip .comet-tooltip-text {
    visibility: hidden; width: max-content; min-width: 100px; background-color: #111827;
    color: #fff; text-align: center; border-radius: 6px; padding: 6px 10px;
    position: absolute; z-index: 10; bottom: 125%; left: 50%; transform: translateX(-50%);
    opacity: 0; transition: opacity 0.3s; font-size: 12px; font-weight: 600;
    pointer-events: none; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.comet-tooltip .comet-tooltip-text::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; 
    border-width: 5px; border-style: solid; border-color: #111827 transparent transparent transparent;
}
.comet-tooltip:hover .comet-tooltip-text, .comet-tooltip:active .comet-tooltip-text { visibility: visible; opacity: 1; }

/* POSICIONES */
.comet-type-posiciones tbody tr:first-child td.comet-cell-rank { background-color: #10b981; color: #ffffff; }
.comet-type-posiciones tbody tr:nth-last-child(2) td.comet-cell-rank,
.comet-type-posiciones tbody tr:last-child td.comet-cell-rank { background-color: #ef4444; color: #ffffff; }
.comet-legend { list-style: none; padding: 0; margin: 16px 0 0 0; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; font-size: 12px; color: #4b5563; }
.comet-legend-item { display: flex; align-items: center; gap: 6px; }
.comet-legend-color { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.color-campeon { background-color: #10b981; }
.color-descenso { background-color: #ef4444; }

/* FIXTURE */
.comet-fixture-bloque { margin-bottom: 24px; overflow: hidden; background: #f5f5f5; padding-bottom: 16px; }
.comet-fixture-titulo { background-color: #71ABEA; color: #ffffff; padding: 20px 16px; margin: 0; font-size: 16px; font-weight: 700; text-transform: uppercase; text-align: center; letter-spacing: 3px; font-family: "Archivo", Sans-serif; }
.comet-match-item { display: flex; align-items: center; padding: 20px 16px; border-bottom: 1px solid #e5e7eb; }
.comet-match-item:last-child { border-bottom: none; }
.comet-match-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.comet-layout-list { display: flex; align-items: center; justify-content: center; width: 100%; }
.comet-list-team { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.comet-list-team .comet-escudo { width: 48px; height: auto; object-fit: contain; }
.comet-list-name { font-weight: 600; font-size: 14px; color: #111827; line-height: 1.2; }
.comet-list-score { margin: 0 16px; font-weight: 700; font-size: 22px; color: #111827; white-space: nowrap; text-align: center; padding: 10px 0 0 0; }
.comet-score-empty { color: #9ca3af; font-weight: 400; font-size: 16px; }
.comet-match-footer { display: flex; flex-direction: column; align-items: center; margin-top: 12px; gap: 4px; }
.comet-date-inline { font-size: 12px; font-weight: 600; color: #4b5563; }
.comet-stadium-tag { font-size: 11px; font-weight: 600; color: #000; }
.comet-match-link { text-decoration: none; color: inherit; display: block; transition: background-color 0.2s; }
.comet-match-link:hover .comet-match-item { background-color: #e5e7eb; cursor: pointer; }

/* BADGES & TARJETAS */
.comet-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.5px; text-align: center; }
.comet-badge-postergado { background-color: #fee2e2; color: #b91c1c; border: 1px solid #f87171; }
.comet-badge-reprogramado { background-color: #fef08a; color: #a16207; border: 1px solid #facc15; }
.card-icon { display: inline-block; width: 12px; height: 16px; border-radius: 2px; vertical-align: middle; }
.card-yellow { background: #eab308; border: 1px solid #ca8a04; }
.card-red { background: #ef4444; border: 1px solid #b91c1c; }
.card-double { position: relative; width: 16px; }
.card-double .c1 { position: absolute; left: 0; top: 0; z-index: 1; }
.card-double .c2 { position: absolute; left: 4px; top: -2px; z-index: 2; }

@media (max-width: 768px) {
    .comet-match-item { padding: 12px 8px; }
    .comet-list-team .comet-escudo { width: 36px; }
    .comet-list-name { font-size: 11px; }
    .comet-list-score { margin: 0 8px; font-size: 16px; }
    .comet-table-clean th, .comet-table-clean td { white-space: nowrap; }
    .comet-type-posiciones .comet-team-name { min-width: 150px; }
}

/* Resaltado de posición 10 (Promoción) - Solo la celda del número */
tr.comet-row-promocion td.comet-cell-rank {
    background-color: #eab308 !important; /* Amarillo más fuerte para que destaque el texto blanco */
    color: #ffffff !important;
}

/* Para asegurarnos de que el resto de la fila NO se pinte de amarillo tenue (pisamos el código anterior) */
tr.comet-row-promocion td:not(.comet-cell-rank) {
    background-color: transparent !important;
}

/* Color en la Leyenda */
.color-promocion {
    background-color: #eab308;
    border: 1px solid #ca8a04; 
}
.page-id-568 .comet-row-promocion .comet-cell-rank {
    color: #6b7280 !important;
    background-color: transparent !important;
}
.page-id-568 .comet-row-promocion .comet-cell-rank {
    color: #6b7280 !important;
    background-color: transparent !important;
}
.page-id-568 .comet-type-posiciones tbody tr:nth-last-child(2) td.comet-cell-rank {
    color: #6b7280 !important;
    background-color: transparent !important;
}