/* ============================================================
   USDSC Search — usdsc-mods/search/search.css
   Search results table + homepage form styling
   ============================================================ */

/* ── Search results wrapper ────────────────────────────────── */

.usdsc-search-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    margin: 24px 0;
    font-size: 14px;
}

.usdsc-search-table thead tr {
    background: #1a3a5c;
    color: #fff;
    text-align: left;
}

.usdsc-search-table thead th {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
}

.usdsc-search-table tbody tr {
    border-bottom: 1px solid #e8ecf0;
    transition: background 0.15s;
}

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

.usdsc-search-table tbody tr:hover {
    background: #f4f8fc;
}

.usdsc-search-table td {
    padding: 14px 16px;
    vertical-align: middle;
    border: none;
}

/* ── Course thumbnail cell ─────────────────────────────────── */

.usdsc-search-table td:first-child {
    width: 72px;
    padding-right: 8px;
}

.usdsc-search-table .thumbnail {
    display: block;
}

.usdsc-search-table .thumbnail img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: none;
}

/* ── Course name ───────────────────────────────────────────── */

.usdsc-course-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a3a5c;
    display: block;
    margin-bottom: 6px;
    line-height: 1.3;
}

.usdsc-search-table td a {
    text-decoration: none;
}

.usdsc-search-table td a:hover .usdsc-course-name {
    color: #2698de;
}

/* ── Price cell ────────────────────────────────────────────── */

.usdsc-search-table td em {
    font-size: 15px;
    font-weight: 700;
    color: #1a3a5c;
    font-style: normal;
}

/* ── Search text input (mod 167) ───────────────────────────── */

input[name="course-search"].home-input {
    min-width: 220px;
    vertical-align: middle;
}

/* ── Inline form layout ────────────────────────────────────── */

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.form-inline .btn {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.form-inline .btn:active {
    transform: scale(0.97);
}

/* ── Mobile: stack search table as cards ───────────────────── */

@media (max-width: 768px) {
    .usdsc-search-table,
    .usdsc-search-table thead,
    .usdsc-search-table tbody,
    .usdsc-search-table tr,
    .usdsc-search-table td {
        display: block;
        width: 100%;
    }

    .usdsc-search-table thead {
        display: none;
    }

    .usdsc-search-table tbody tr {
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        margin-bottom: 16px;
        padding: 12px;
        border: 1px solid #e0e8f0;
    }

    .usdsc-search-table tbody tr:hover {
        background: #f4f8fc;
    }

    .usdsc-search-table td {
        padding: 6px 8px;
        border: none;
    }

    .usdsc-search-table td:first-child {
        width: 100%;
    }

    .usdsc-search-table td[data-label]::before {
        content: attr(data-label) ': ';
        font-weight: 600;
        color: #1a3a5c;
    }

    input[name="course-search"].home-input {
        width: 100%;
        min-width: unset;
        box-sizing: border-box;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .usdsc-search-table tbody tr {
        padding: 10px;
    }
}

/* ── Live search dropdown ──────────────────────────────────── */

.usdsc-ls-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 360px;
    max-width: 540px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccd6e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
    z-index: 9999;
}

.usdsc-ls-dropdown.is-open {
    display: block;
}

.usdsc-ls-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    border-bottom: 1px solid #f0f4f8;
    transition: background 0.12s;
    cursor: pointer;
}

.usdsc-ls-item:last-of-type {
    border-bottom: none;
}

.usdsc-ls-item:hover,
.usdsc-ls-item.is-active {
    background: #f0f7ff;
}

.usdsc-ls-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: #e8ecf0;
}

.usdsc-ls-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.usdsc-ls-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a3a5c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usdsc-ls-meta {
    font-size: 12px;
    color: #6b7f96;
}

.usdsc-ls-loading,
.usdsc-ls-empty {
    padding: 16px;
    font-size: 14px;
    color: #6b7f96;
    text-align: center;
}

.usdsc-ls-all {
    display: block;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #2698de;
    text-align: center;
    text-decoration: none;
    background: #f8fafc;
    border-top: 1px solid #e8ecf0;
    transition: background 0.12s;
}

.usdsc-ls-all:hover {
    background: #e8f4fd;
    color: #1a6fa8;
}

@media (max-width: 640px) {
    .usdsc-ls-dropdown {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        left: 0;
        right: 0;
    }
}
