/* =====================================================================
   JE SHARED UI — Courses / Universities / MBA Specializations
   One design system for tabs, pagination and cards so all three
   discovery pages look and behave identically. Loaded once, sitewide.
   ===================================================================== */

:root {
    --je-primary: #3883C4;
    --je-primary-dark: #2c6ba0;
    --je-text: #1a1a1a;
    --je-text-muted: #666;
    --je-border: #e7edf3;
    --je-bg-alt: #f7fafd;
    --je-bg-chip: #f0f4f8;
    --je-radius: 14px;
    --je-radius-sm: 8px;
    --je-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --je-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.10);
}

/* ---------------------------------------------------------------------
   TABS — horizontal (top-level category tabs / filter-style tabs)
   Markup:
   <div class="je-tabs" role="tablist">
     <button class="je-tab-btn active" data-tab-target="#id">Label</button>
   </div>
   <div class="je-tab-panel" id="id"> ... </div>
   --------------------------------------------------------------------- */
.je-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 4px 2px 14px;
    margin: 0 0 26px;
    border-bottom: 1px solid var(--je-border);
}

.je-tabs::-webkit-scrollbar { height: 5px; }
.je-tabs::-webkit-scrollbar-thumb { background: var(--je-border); border-radius: 10px; }

.je-tab-btn {
    flex: 0 0 auto;
    border: 1px solid var(--je-border);
    background: #fff;
    color: var(--je-text);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.je-tab-btn:hover {
    border-color: var(--je-primary);
    color: var(--je-primary);
    transform: translateY(-1px);
}

.je-tab-btn.active {
    background: var(--je-primary);
    border-color: var(--je-primary);
    color: #fff;
}

.je-tab-btn:focus-visible {
    outline: 2px solid var(--je-primary-dark);
    outline-offset: 2px;
}

.je-tab-panel { display: none; }
.je-tab-panel.active { display: block; }

/* ---------------------------------------------------------------------
   TABS — vertical / sidebar variant (course & specialization pickers)
   Same visual language as .je-tab-btn, stacked instead of scrolled.
   --------------------------------------------------------------------- */
.je-tabs--vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: visible;
    border-bottom: none;
    padding: 0;
    margin: 0;
}

.je-tabs--vertical .je-tab-btn {
    width: 100%;
    text-align: left;
    border-radius: var(--je-radius-sm);
    white-space: normal;
}

@media (max-width: 767px) {
    .je-tabs--vertical {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }
    .je-tabs--vertical .je-tab-btn {
        width: auto;
        white-space: nowrap;
    }
}

/* ---------------------------------------------------------------------
   PAGINATION — identical on every tab/panel across all 3 pages.
   Populated by je-shared-ui.js's JE.paginate().
   --------------------------------------------------------------------- */
.je-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
}

.je-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--je-radius-sm);
    border: 1px solid var(--je-border);
    background: #fff;
    color: var(--je-text);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

.je-page-btn.active {
    background: var(--je-primary);
    border-color: var(--je-primary);
    color: #fff;
}

.je-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------
   UNIVERSITY CARD — logo, name, location. Deliberately minimal per
   design spec ("avoid overcrowding"); full detail lives on the
   university's own page.
   --------------------------------------------------------------------- */
.je-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
}

.je-uni-card {
    background: #fff;
    border: 1px solid var(--je-border);
    border-radius: var(--je-radius);
    box-shadow: var(--je-shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.je-uni-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--je-shadow-hover);
}

.je-uni-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.je-uni-card-logo-wrap {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--je-bg-alt);
    padding: 18px;
    border-bottom: 1px solid var(--je-border);
}

.je-uni-card-logo-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.je-uni-card-body {
    padding: 18px 20px 22px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.je-uni-card-name {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--je-text);
    line-height: 1.35;
    margin: 0 0 8px;
}

.je-uni-card-location {
    font-size: 13px;
    color: var(--je-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 auto;
}

.je-uni-card-cta {
    margin-top: 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--je-primary);
}

/* Responsive: keep 2 columns on small tablets, 1 on phones */
@media (max-width: 991px) {
    .je-card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 575px) {
    .je-card-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 400px) {
    .je-card-grid { grid-template-columns: 1fr; }
}

/* Touch-friendly tap targets on small screens */
@media (max-width: 767px) {
    .je-tab-btn { padding: 11px 18px; font-size: 13px; }
    .je-page-btn { min-width: 40px; height: 40px; }
}
