/* ============================================================
   Course Enrollment Directory — Frontend Styles
   ============================================================ */

.ced-widget {
    width: 100%;
    font-family: inherit;
}

.ced-widget *,
.ced-widget *::before,
.ced-widget *::after {
    box-sizing: border-box;
}

/* Search Title */
.ced-search-title {
    font-size: 1.1em;
    font-weight: 600;
    color: inherit;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* Search bar */
.ced-search-wrap {
    position: relative;
    margin-bottom: 20px;
}

.ced-search-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 1em;
    font-family: inherit;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ced-search-input:focus {
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

.ced-loading {
    display: none;
    margin-top: 8px;
    font-size: 0.85em;
    color: #9ca3af;
    font-style: italic;
}

.ced-loading.ced-visible {
    display: block;
}

/* Results info */
.ced-results-info {
    display: none;
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 10px;
}

.ced-results-info.ced-visible {
    display: block;
}

/* Table wrap */
.ced-table-wrap {
    display: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.ced-table-wrap.ced-visible {
    display: block;
}

/* Table */
.ced-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.ced-table thead tr {
    background-color: #f3f4f6;
}

.ced-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8em;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border-bottom: 1px solid #e5e7eb;
}

.ced-table tbody tr {
    background-color: #fff;
    transition: background-color 0.12s ease;
}

.ced-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.ced-table tbody tr:hover {
    background-color: #f0f4ff;
}

.ced-table tbody td {
    padding: 11px 16px;
    color: #374151;
    font-size: 0.92em;
    border-bottom: 1px solid #f0f1f3;
    word-break: break-word;
    vertical-align: middle;
}

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

/* No results */
.ced-no-results {
    display: none;
    padding: 18px 22px;
    border: 1px solid #fde68a;
    background-color: #fffbeb;
    color: #92400e;
    border-radius: 6px;
    font-size: 0.95em;
    text-align: center;
    line-height: 1.5;
}

.ced-no-results.ced-visible {
    display: block;
}

/* Pagination */
.ced-pagination {
    display: none;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.ced-pagination.ced-visible {
    display: flex;
}

.ced-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 6px 12px;
    font-size: 0.875em;
    font-family: inherit;
    font-weight: 500;
    color: #374151;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1.4;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ced-pagination button:hover:not(:disabled) {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.ced-pagination button.active {
    background-color: #374151;
    border-color: #374151;
    color: #fff;
    font-weight: 700;
    cursor: default;
}

.ced-pagination button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ced-pagination .ced-ellipsis {
    padding: 0 4px;
    color: #9ca3af;
    font-size: 0.875em;
    line-height: 36px;
}

/* Mobile */
@media (max-width: 600px) {
    .ced-search-input {
        font-size: 16px;
    }

    .ced-table thead th,
    .ced-table tbody td {
        padding: 9px 12px;
    }

    .ced-table {
        font-size: 0.875em;
    }

    .ced-pagination button {
        padding: 6px 10px;
        min-width: 32px;
    }
}
