/* =============================================================================
   ECF LMS Plugin — Frontend Styles
   ============================================================================= */

/* Wrapper */
.ecf-lms-wrap {
    margin: 1.5rem 0;
    overflow-x: auto;          /* Handles narrow viewports gracefully */
    -webkit-overflow-scrolling: touch;
}

/* Title */
.ecf-lms-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.ecf-lms-season {
    font-size: 0.85em;
    font-weight: 400;
    color: #666;
}

/* -----------------------------------------------------------------------
   Table
   ----------------------------------------------------------------------- */
.ecf-lms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.4;
    background: #fff;
    border: 1px solid #ddd;
}

.ecf-lms-table thead th {
    background: #1a3a5c;       /* Dark navy — adjust to your theme */
    color: #fff;
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.ecf-lms-table tbody tr.even {
    background: #f8f9fa;
}

.ecf-lms-table tbody tr.odd {
    background: #fff;
}

.ecf-lms-table tbody tr:hover {
    background: #e8f0fb;
}

.ecf-lms-table tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
}

/* Numeric columns — right-align short fields like P, W, D, L, Pts */
.ecf-lms-table tbody td:nth-child(n+2) {
    text-align: right;
}

/* But keep the first column (team name) left-aligned */
.ecf-lms-table tbody td:first-child {
    text-align: left;
    font-weight: 500;
}

.ecf-lms-table thead th:nth-child(n+2) {
    text-align: right;
}

.ecf-lms-table thead th:first-child {
    text-align: left;
}

/* -----------------------------------------------------------------------
   Notices, errors, debug
   ----------------------------------------------------------------------- */
.ecf-lms-notice,
.ecf-lms-error {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin: 0.75rem 0;
}

.ecf-lms-notice {
    background: #f0f4f8;
    border-left: 3px solid #999;
    color: #555;
}

.ecf-lms-error {
    background: #fff3f3;
    border-left: 3px solid #c0392b;
    color: #7b1a1a;
}

.ecf-lms-debug {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.8rem;
}

.ecf-lms-debug pre {
    overflow-x: auto;
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    max-height: 400px;
}

/* Seasons list */
.ecf-lms-seasons {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ecf-lms-seasons li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

/* -----------------------------------------------------------------------
   Responsive — stack columns on narrow screens
   ----------------------------------------------------------------------- */
@media (max-width: 600px) {
    .ecf-lms-table {
        border: none;
    }

    .ecf-lms-table thead {
        display: none;          /* Hide headers; use data-label instead */
    }

    .ecf-lms-table tbody tr {
        display: block;
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 0.75rem;
        padding: 0.25rem 0;
    }

    .ecf-lms-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.4rem 0.75rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .ecf-lms-table tbody td:last-child {
        border-bottom: none;
    }

    .ecf-lms-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #888;
        text-align: left;
        flex: 1;
        padding-right: 0.5rem;
    }
}

/* Rating data attribution */
.ecf-lms-attribution {
    font-size: 0.75rem;
    color: #999;
    margin: 0.4rem 0 0;
    text-align: right;
}
