/* ============================================================
   JCA CricClubs Integration — Widget Styles
   jakartacricket.com
   ============================================================ */

/* ── Base widget container ── */
.jca-widget {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border: 1px solid #e0dbd0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    background: #ffffff;
}

/* ── Widget header bar ── */
.jca-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: #1a3a1a; /* overridden by inline PHP color */
}
.jca-widget-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.jca-widget-link {
    font-size: 11px;
    font-weight: 600;
    color: #c9a84c;
    text-decoration: none;
    letter-spacing: 0.05em;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.jca-widget-link:hover { opacity: 1; text-decoration: underline; }

/* ── Widget footer ── */
.jca-widget-footer {
    background: #f8f5f0;
    border-top: 1px solid #ede9e0;
    padding: 6px 16px;
    font-size: 10px;
    color: #999;
    text-align: right;
    letter-spacing: 0.04em;
}

/* ── No data / error state ── */
.jca-no-data {
    padding: 24px 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
    font-style: italic;
}
.jca-no-data a { color: #1a3a1a; }

/* ============================================================
   STANDINGS TABLE
   ============================================================ */
.jca-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.jca-table thead th {
    background: #1a3a1a;
    color: rgba(255,255,255,0.75);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 12px;
    text-align: center;
}
.jca-table thead th:nth-child(2) { text-align: left; }

.jca-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid #f0ece4;
    text-align: center;
    vertical-align: middle;
    color: #222;
}
.jca-table tbody td:nth-child(2) { text-align: left; }
.jca-table tbody tr:last-child td { border-bottom: none; }
.jca-table tbody tr:nth-child(even) td { background: #faf8f4; }
.jca-table tbody tr:hover td { background: rgba(201,168,76,0.08); }

/* Rank cell */
.jca-rank {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    width: 32px;
}
.jca-rank.jca-top {
    color: #1a3a1a;
    background: rgba(201,168,76,0.2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jca-team-name { font-weight: 600; }

/* NRR colours */
.jca-pos { color: #2d7a4f; font-weight: 600; }
.jca-neg { color: #c0392b; font-weight: 600; }

/* Points */
.jca-pts { font-weight: 800; font-size: 14px; }

/* ============================================================
   FIXTURES
   ============================================================ */
.jca-fixture-list { display: flex; flex-direction: column; }

.jca-fixture-row {
    display: grid;
    grid-template-columns: 80px 1fr 30px 1fr 90px;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-bottom: 1px solid #f0ece4;
    font-size: 13px;
    transition: background 0.15s;
}
.jca-fixture-row:last-child { border-bottom: none; }
.jca-fixture-row:hover { background: rgba(201,168,76,0.06); }

.jca-fixture-date {
    font-size: 11px;
    color: #888;
    line-height: 1.4;
}
.jca-fixture-home { font-weight: 600; color: #1a1a1a; }
.jca-fixture-vs   { text-align: center; font-size: 10px; font-weight: 700; color: #bbb; }
.jca-fixture-away { font-weight: 600; color: #1a1a1a; text-align: right; }
.jca-fixture-venue {
    text-align: right;
    font-size: 11px;
    color: #aaa;
    font-style: italic;
}

/* ============================================================
   RECENT SCORES
   ============================================================ */
.jca-score-list { display: flex; flex-direction: column; }

.jca-score-card {
    padding: 12px 16px;
    border-bottom: 1px solid #f0ece4;
    border-left: 3px solid #1a3a1a;
    margin: 0;
    transition: background 0.15s;
}
.jca-score-card:last-child { border-bottom: none; }
.jca-score-card:hover { background: rgba(201,168,76,0.05); }

.jca-score-date {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
}
.jca-score-teams {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.jca-score-home,
.jca-score-away     { font-weight: 600; color: #1a1a1a; }
.jca-score-separator { font-size: 10px; color: #ccc; font-weight: 700; }

.jca-score-result {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    font-style: italic;
}

/* ============================================================
   RESPONSIVE (Mobile)
   ============================================================ */
@media ( max-width: 600px ) {

    .jca-fixture-row {
        grid-template-columns: 60px 1fr 20px 1fr;
        font-size: 12px;
        padding: 10px 12px;
    }
    .jca-fixture-venue { display: none; } /* hide venue on small screens */

    .jca-table { font-size: 12px; }
    .jca-table thead th,
    .jca-table tbody td { padding: 7px 8px; }

    .jca-score-teams { flex-direction: column; align-items: flex-start; gap: 3px; }
    .jca-score-separator { display: none; }
}