/* ============================================================
   Courses Table Manager — Frontend Styles
   Desktop: standard table | Mobile ≤768px: stacked card view
   ============================================================ */

.ctm-table-wrapper {
    width: 100%;
    overflow: visible; /* no horizontal scroll */
}

/* ── Table base ── */
.ctm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ctm-table thead th {
    background: #1a3c5e;
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ctm-table thead th:last-child {
    text-align: center;
}

.ctm-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.15s ease;
}

.ctm-table tbody tr:last-child {
    border-bottom: none;
}

.ctm-table tbody tr:hover {
    background: #f0f4f8;
}

.ctm-table td {
    padding: 13px 16px;
    vertical-align: middle;
    color: #374151;
}

.ctm-table td:last-child {
    text-align: center;
}

/* ── Book Now button ── */
.ctm-btn {
    display: inline-block;
    padding: 7px 18px;
    background: #1a3c5e;
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.1s ease;
}

.ctm-btn:hover,
.ctm-btn:focus {
    background: #2c5282;
    color: #fff !important;
    transform: translateY(-1px);
    outline: none;
}

/* ── Empty state ── */
p.ctm-empty {
    color: #6b7280;
    font-style: italic;
}

/* ============================================================
   Mobile card layout  (≤768px)
   ============================================================ */
@media (max-width: 768px) {

    /* Hide the header row — labels come from data-label */
    .ctm-table thead {
        display: none;
    }

    /* Each element becomes block so rows stack */
    .ctm-table,
    .ctm-table tbody,
    .ctm-table tr,
    .ctm-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    /* Each row becomes a card */
    .ctm-table tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        margin-bottom: 16px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }

    /* Card header — course name */
    .ctm-table td:first-child {
        background: #1a3c5e;
        color: #fff;
        font-weight: 700;
        font-size: 1rem;
        padding: 14px 16px;
        border-bottom: none;
    }

    .ctm-table td:first-child::before {
        display: none; /* no label needed for the card title */
    }

    /* Body rows */
    .ctm-table td {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 16px;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
    }

    .ctm-table td:last-child {
        border-bottom: none;
        padding: 14px 16px;
        text-align: left;
        justify-content: flex-start;
    }

    /* Label (from data-label attribute) */
    .ctm-table td:not(:first-child)::before {
        content: attr(data-label);
        font-weight: 700;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        min-width: 80px;
        padding-top: 2px;
        flex-shrink: 0;
    }

    /* Full-width button on mobile */
    .ctm-btn {
        width: 100%;
        text-align: center;
        padding: 10px 18px;
        font-size: 0.95rem;
    }
}
