/* ════════════════════════════════════════════
   University Programs Table — styles.css
   Modern, clean design system
════════════════════════════════════════════ */

/* ── Design Tokens ── */
.upt-wrapper {
    --upt-primary:       #0f2d6e;
    --upt-primary-light: #1a3f8f;
    --upt-primary-pale:  #eef2fb;
    --upt-accent:        #16a34a;
    --upt-accent-light:  #dcfce7;
    --upt-surface:       #ffffff;
    --upt-border:        #e2e8f0;
    --upt-border-hover:  #94a3b8;
    --upt-text:          #0f172a;
    --upt-text-muted:    #64748b;
    --upt-text-light:    #94a3b8;
    --upt-shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --upt-shadow-md:     0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
    --upt-radius:        10px;
    --upt-radius-sm:     6px;
    --upt-radius-full:   999px;
    --upt-transition:    .18s cubic-bezier(.4,0,.2,1);

    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 56px;
    color: var(--upt-text);
    -webkit-font-smoothing: antialiased;
}

/* ── Logo ── */
.upt-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding-top: 8px;
}

.upt-logo {
    max-height: 96px;
    max-width: 240px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.10));
}

/* ── Heading ── */
.upt-heading {
    text-align: center;
    font-size: clamp(17px, 2.4vw, 22px);
    font-weight: 700;
    color: var(--upt-primary);
    margin: 0 0 28px;
    line-height: 1.35;
    letter-spacing: -.01em;
}

/* ══════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════ */
.upt-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.upt-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 18px;
    border: 1.5px solid var(--upt-border);
    border-radius: var(--upt-radius-full);
    background: var(--upt-surface);
    color: var(--upt-primary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--upt-transition),
                background var(--upt-transition),
                color var(--upt-transition),
                box-shadow var(--upt-transition);
    line-height: 1;
}

.upt-filter-btn:hover {
    border-color: var(--upt-primary);
    background: var(--upt-primary-pale);
    box-shadow: var(--upt-shadow-sm);
}

.upt-filter-btn.is-active {
    background: var(--upt-primary);
    border-color: var(--upt-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15,45,110,.25);
}

/* ══════════════════════════════════════════
   SEARCH
══════════════════════════════════════════ */
.upt-search-container {
    position: relative;
    margin-bottom: 12px;
}

.upt-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--upt-text-light);
    pointer-events: none;
    transition: color var(--upt-transition);
}

.upt-search-container:focus-within .upt-search-icon {
    color: var(--upt-primary);
}

.upt-search-input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 1.5px solid var(--upt-border);
    border-radius: var(--upt-radius);
    font-size: 15px;
    color: var(--upt-text);
    background: var(--upt-surface);
    box-shadow: var(--upt-shadow-sm);
    transition: border-color var(--upt-transition), box-shadow var(--upt-transition);
    box-sizing: border-box;
    outline: none;
}

.upt-search-input::placeholder { color: var(--upt-text-light); }

.upt-search-input:focus {
    border-color: var(--upt-primary);
    box-shadow: 0 0 0 3px rgba(15,45,110,.12), var(--upt-shadow-sm);
}

/* ── Results info ── */
.upt-results-info {
    margin-bottom: 10px;
    min-height: 20px;
}

.upt-results-count {
    font-size: 13px;
    color: var(--upt-text-muted);
}

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.upt-table-container {
    border-radius: var(--upt-radius);
    box-shadow: var(--upt-shadow-md);
    overflow: hidden;
    overflow-x: auto;
    border: 1px solid var(--upt-border);
}

.upt-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--upt-surface);
    font-size: 14px;
}

/* ── Table Head ── */
.upt-table thead tr {
    background: var(--upt-primary);
}

.upt-table thead th {
    padding: 14px 18px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    color: rgba(255,255,255,.9);
    white-space: nowrap;
    user-select: none;
}

.upt-table thead th.upt-sortable {
    cursor: pointer;
}

.upt-table thead th.upt-sortable:hover {
    background: var(--upt-primary-light);
    color: #fff;
}

.upt-table thead th.upt-sorted {
    background: var(--upt-primary-light);
    color: #fff;
}

.upt-sort-arrow {
    display: inline-block;
    margin-left: 4px;
    opacity: .55;
    font-size: 12px;
    transition: opacity var(--upt-transition);
}

.upt-sortable:hover .upt-sort-arrow,
.upt-sorted .upt-sort-arrow {
    opacity: 1;
}

/* ── Table Body ── */
.upt-table tbody tr {
    border-bottom: 1px solid var(--upt-border);
    transition: background var(--upt-transition);
}

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

.upt-table tbody tr:hover {
    background: #f8faff;
}

.upt-table tbody td {
    padding: 15px 18px;
    vertical-align: middle;
}

/* Hidden by filter/search/pagination */
.upt-row.upt-hidden {
    display: none;
}

/* ── Program Cell ── */
.upt-col-program { min-width: 260px; }

.upt-program-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upt-row-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: var(--upt-radius-sm);
    flex-shrink: 0;
    border: 1px solid var(--upt-border);
    padding: 2px;
    background: #fff;
}

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

.upt-university-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--upt-primary);
    letter-spacing: .05em;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(15,45,110,.3);
}

.upt-program-name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--upt-text);
    line-height: 1.35;
}

/* ── Badges ── */
.upt-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--upt-radius-full);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
}

.upt-badge--degree {
    background: var(--upt-primary-pale);
    color: var(--upt-primary);
    border: 1px solid rgba(15,45,110,.15);
}

.upt-badge--language {
    background: #f1f5ff;
    color: #2d4a8a;
    border: 1px solid rgba(45,74,138,.15);
}

.upt-flag { font-size: 14px; }

/* ── Price Cell ── */
.upt-col-price {
    min-width: 140px;
    text-align: right;
    white-space: nowrap;
}

.upt-price-original {
    display: block;
    font-size: 12px;
    color: var(--upt-text-light);
    text-decoration: line-through;
    text-align: right;
    margin-bottom: 2px;
}

.upt-price-discounted {
    display: inline-block;
    background: var(--upt-accent);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: var(--upt-radius-sm);
    letter-spacing: -.01em;
    box-shadow: 0 2px 6px rgba(22,163,74,.25);
}

.upt-price-period {
    display: block;
    font-size: 11px;
    color: var(--upt-text-muted);
    text-align: right;
    margin-top: 3px;
}

/* ── Apply Button ── */
.upt-col-apply {
    text-align: center;
    white-space: nowrap;
    min-width: 110px;
}

.upt-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    background: var(--upt-primary);
    color: #fff !important;
    border-radius: var(--upt-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background var(--upt-transition),
                transform var(--upt-transition),
                box-shadow var(--upt-transition);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15,45,110,.2);
}

.upt-apply-btn:hover {
    background: var(--upt-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,45,110,.25);
}

.upt-apply-btn:active {
    transform: translateY(0);
}

/* ══════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════ */
.upt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 24px;
    background: #f8faff;
    border: 1.5px dashed var(--upt-border);
    border-radius: var(--upt-radius);
    margin-top: 12px;
    color: var(--upt-text-muted);
    text-align: center;
}

.upt-empty-state svg {
    width: 40px;
    height: 40px;
    opacity: .35;
}

.upt-empty-state p {
    margin: 0;
    font-size: 15px;
}

.upt-clear-btn {
    padding: 8px 20px;
    border: 1.5px solid var(--upt-border);
    border-radius: var(--upt-radius-full);
    background: #fff;
    color: var(--upt-primary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--upt-transition);
}

.upt-clear-btn:hover {
    border-color: var(--upt-primary);
    background: var(--upt-primary-pale);
}

/* ══════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════ */
.upt-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.upt-page-btn {
    padding: 9px 18px;
    border: 1.5px solid var(--upt-border);
    border-radius: var(--upt-radius-sm);
    background: var(--upt-surface);
    color: var(--upt-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--upt-transition);
    white-space: nowrap;
}

.upt-page-btn:hover:not(:disabled) {
    border-color: var(--upt-primary);
    background: var(--upt-primary-pale);
}

.upt-page-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.upt-page-numbers {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.upt-page-number {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--upt-border);
    border-radius: var(--upt-radius-sm);
    background: var(--upt-surface);
    color: var(--upt-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--upt-transition);
    padding: 0 6px;
}

.upt-page-number:hover {
    border-color: var(--upt-primary);
    background: var(--upt-primary-pale);
}

.upt-page-number.is-current {
    background: var(--upt-primary);
    border-color: var(--upt-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15,45,110,.25);
}

.upt-page-ellipsis {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    color: var(--upt-text-muted);
    font-size: 14px;
    cursor: default;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 768px) {
    .upt-heading { font-size: 16px; margin-bottom: 20px; }

    .upt-table thead th { padding: 11px 12px; font-size: 10.5px; }
    .upt-table tbody td { padding: 12px 12px; }

    .upt-col-program { min-width: 200px; }
    .upt-program-name { font-size: 13px; }
    .upt-row-logo { width: 30px; height: 30px; }

    .upt-price-discounted { font-size: 15px; padding: 4px 10px; }
    .upt-apply-btn { padding: 8px 14px; font-size: 13px; }
    .upt-filter-btn { font-size: 12.5px; padding: 6px 13px; }
    .upt-search-input { font-size: 15px; }

    .upt-pagination { gap: 6px; }
    .upt-page-btn { padding: 8px 14px; font-size: 13px; }
    .upt-page-number { min-width: 34px; height: 34px; font-size: 13px; }
}

@media (max-width: 480px) {
    .upt-wrapper { padding: 0 10px 40px; }
    .upt-filter-bar { gap: 6px; }
    .upt-page-btn { padding: 7px 12px; }
}
