/**
 * Lottoced API Plugin — Foglio di stile
 *
 * Tutti i selettori sono prefissati con ".lottoced-" o "#lottoced-"
 * per impedire conflitti con il tema attivo o altri plugin.
 */

/* ==========================================================================
   Reset locale (scoped, non tocca nulla fuori dal plugin)
   ========================================================================== */

.lottoced-card *,
.lottoced-card *::before,
.lottoced-card *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Card contenitore principale
   ========================================================================== */

.lottoced-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #ffffff;
    overflow: auto;
    max-width: 100%;
    margin: 16px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #111827;
    line-height: 1.5;
}

.lottoced-card--shadow {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    max-width: 780px;
}

.lottoced-card--wide {
    max-width: 900px;
}

.lottoced-card h3.lottoced-title {
    margin: 0 0 12px;
    color: #111827;
    font-size: 1.2em;
    font-weight: 700;
    line-height: 1.3;
}

.lottoced-card h4.lottoced-subtitle {
    margin: 0 0 12px;
    color: #111827;
    font-size: 1em;
    font-weight: 600;
}

.lottoced-card p.lottoced-meta {
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 0.9em;
}

/* ==========================================================================
   Sezione dentro la card (divider)
   ========================================================================== */

.lottoced-section {
    margin-bottom: 14px;
}

.lottoced-section--divided {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.lottoced-section-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9em;
    color: #374151;
}

/* ==========================================================================
   Badge numeri (1-90, cifre singole)
   ========================================================================== */

.lottoced-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    margin: 0 4px 6px 0;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    color: #ffffff;
}

/* Colori badge per tipo estrazione */
.lottoced-badge--default  { background: #1e40af; } /* numeri principali   */
.lottoced-badge--digit    { background: #111827; } /* cifre FAI           */
.lottoced-badge--oro      { background: #d97706; } /* numero oro          */
.lottoced-badge--doppiooro{ background: #b45309; } /* doppio oro          */
.lottoced-badge--extra    { background: #065f46; } /* extra               */
.lottoced-badge--simbolo  { background: #6d28d9; } /* simbolotto          */

/* ==========================================================================
   Tabelle estrazioni
   ========================================================================== */

.lottoced-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lottoced-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
    font-size: 14px;
}

.lottoced-table th {
    text-align: left;
    border-bottom: 1px solid #d1d5db;
    padding: 10px 12px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.lottoced-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 12px;
    vertical-align: middle;
}

.lottoced-table tr:last-child td {
    border-bottom: none;
}

/* Colonna numero / ruota */
.lottoced-table td.lottoced-table__num {
    font-weight: 700;
    white-space: nowrap;
    min-width: 60px;
}

.lottoced-table td.lottoced-table__ruota {
    font-weight: 600;
    min-width: 110px;
    white-space: nowrap;
}

/* Evidenzia righe al hover */
.lottoced-table tbody tr:hover {
    background: #f9fafb;
}

/* Tabella ritardi: colore caldo se ritardo alto */
.lottoced-table td.lottoced-table__ritardo--alto {
    color: #dc2626;
    font-weight: 700;
}

/* ==========================================================================
   Tabella statistiche posizionali (FAI)
   ========================================================================== */

.lottoced-stats-block {
    margin-top: 16px;
}

.lottoced-stats-block h4.lottoced-subtitle {
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.lottoced-position-block {
    margin-bottom: 20px;
}

.lottoced-position-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    text-transform: capitalize;
    font-size: 0.9em;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   Messaggio di errore
   ========================================================================== */

.lottoced-error {
    padding: 12px 16px;
    border: 1px solid #e0b4b4;
    background: #fff6f6;
    color: #9f3a38;
    border-radius: 8px;
    font-size: 14px;
    margin: 12px 0;
}

.lottoced-error::before {
    content: "⚠ ";
    font-style: normal;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .lottoced-card {
        padding: 14px;
        border-radius: 8px;
    }

    .lottoced-badge {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
        padding: 0 6px;
    }

    .lottoced-table th,
    .lottoced-table td {
        padding: 8px;
        font-size: 13px;
    }
}
