/* ==========================================
   UNIVERSITY DETAILS PAGE
   public/assets/css/university-details.css
   ========================================== */

/* ---------- HERO ---------- */
.ud-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    padding: 35px 0 40px;
    color: #fff;
}

.ud-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 20, 40, .72), rgba(0, 20, 40, .90));
}

.ud-hero-inner {
    position: relative;
    z-index: 2;
}

/* breadcrumb */
.ud-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 26px;
    color: rgba(255, 255, 255, .65);
}

.ud-breadcrumb a {
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
    transition: color .25s ease;
}

.ud-breadcrumb a:hover { color: #ffb98a; }
.ud-breadcrumb i       { font-size: 10px; opacity: .6; }
.ud-breadcrumb span    { color: #fff; }

/* identity */
.ud-identity {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.ud-logo {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.ud-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ud-headline { flex: 1 1 300px; }

.ud-name {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 8px;
}

.ud-location {
    font-size: 15px;
    margin: 0 0 14px;
    color: rgba(255, 255, 255, .8);
}

.ud-location i { color: #e8500f; margin-right: 6px; }

/* chips */
.ud-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ud-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 40px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ud-chip-rank {
    background: #198754;
    border-color: #198754;
}

/* hero buttons */
.ud-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.ud-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 30px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: all .25s ease;
}

.ud-btn-apply {
    background: #198754;
    color: #fff;
}

.ud-btn-apply:hover {
    background: #157347;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(232, 80, 15, .35);
}

.ud-btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .5);
}

.ud-btn-ghost:hover {
    background: #fff;
    color: #003863;
    transform: translateY(-3px);
}

/* ---------- STICKY TAB BAR ---------- */
.ud-tabbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    border-bottom: 1px solid #ececec;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
}

.ud-tabs {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scrollbar-width: none;
}

.ud-tabs::-webkit-scrollbar { display: none; }

.ud-tab {
    position: relative;
    padding: 16px 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #666;
    text-decoration: none;
    transition: color .25s ease;
}

.ud-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: #e8500f;
    transform: scaleX(0);
    transition: transform .25s ease;
}

.ud-tab:hover           { color: #e8500f; }
.ud-tab.is-active       { color: #e8500f; }
.ud-tab.is-active::after { transform: scaleX(1); }

/* ---------- MAIN ---------- */
.ud-main { background: #f7f8fa; }

.ud-block {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .06);
    scroll-margin-top: 110px;
}

.ud-block:last-child { margin-bottom: 0; }

.ud-block-title {
    font-size: 24px;
    font-weight: 700;
    color: #003863;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.ud-block-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 60px;
    height: 2px;
    background: #e8500f;
}

.ud-lead {
    font-size: 17px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 16px;
}

/* CKEditor output */
.ud-content {
    font-size: 16px;
    line-height: 1.85;
    color: #555;
}

.ud-content h2,
.ud-content h3,
.ud-content h4 {
    color: #003863;
    font-weight: 700;
    margin: 26px 0 12px;
}

.ud-content h2 { font-size: 22px; }
.ud-content h3 { font-size: 19px; }
.ud-content h4 { font-size: 17px; }

.ud-content p  { margin-bottom: 16px; }
.ud-content ul,
.ud-content ol { margin: 0 0 16px; padding-left: 22px; }
.ud-content li { margin-bottom: 8px; }
.ud-content a  { color: #0b82d0; }

.ud-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

/* ---------- FACILITIES ---------- */
.ud-facilities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.ud-facility {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fcfcfd;
    transition: all .25s ease;
}

.ud-facility:hover {
    border-color: #198754;
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(232, 51, 109, .12);
}

.ud-facility i {
    font-size: 20px;
    /* color: #e8336d; */
    color: #157347;
    width: 24px;
    text-align: center;
}

.ud-facility span {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

/* ---------- ADMISSION STEPS ---------- */
.ud-steps {
    counter-reset: step;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ud-steps li {
    position: relative;
    padding: 0 0 22px 52px;
    counter-increment: step;
}

.ud-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #003863;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ud-steps li::after {
    content: "";
    position: absolute;
    left: 17px;
    top: 38px;
    bottom: 4px;
    width: 1px;
    background: #e2e2e2;
}

.ud-steps li:last-child { padding-bottom: 0; }
.ud-steps li:last-child::after { display: none; }

.ud-steps b {
    display: block;
    font-size: 16px;
    color: #003863;
    margin-bottom: 4px;
}

.ud-steps span {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
}

/* ---------- NOTE + INLINE BUTTON ---------- */
.ud-note {
    font-size: 16px;
    line-height: 1.75;
    color: #555;
    margin-bottom: 18px;
}

.ud-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    background: #003863;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: all .25s ease;
}

.ud-inline-btn:hover {
    background: #002a4a;
    color: #fff;
    transform: translateY(-2px);
}

.ud-inline-btn i { transition: transform .25s ease; }
.ud-inline-btn:hover i { transform: translateX(4px); }

/* ---------- SIDEBAR ---------- */
.ud-sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ud-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .06);
}

.ud-card-title {
    font-size: 19px;
    font-weight: 700;
    color: #003863;
    margin: 0 0 16px;
}

.ud-facts {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.ud-facts li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px dashed #e8e8e8;
    font-size: 14px;
}

.ud-facts li:last-child { border-bottom: 0; }

.ud-facts span { color: #888; flex-shrink: 0; }

.ud-facts b {
    color: #003863;
    font-weight: 600;
    text-align: center;
}

.ud-facts a { color: #0b82d0; text-decoration: none; }
.ud-facts a:hover { text-decoration: underline; }

.ud-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px;
    background: #198754;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: all .25s ease;
}

.ud-card-btn:hover {
    background: #157347;
    color: #fff;
}

.ud-card-btn i { transition: transform .25s ease; }
.ud-card-btn:hover i { transform: translateX(4px); }

/* ---------- TABLET ---------- */
@media (max-width: 991px) {
    .ud-hero  { padding: 50px 0 34px; }
    .ud-name  { font-size: 27px; }
    .ud-logo  { width: 78px; height: 78px; }

    .ud-sidebar { position: static; }

    .ud-block { padding: 24px; }
    .ud-block-title { font-size: 21px; }
}

/* ---------- MOBILE ---------- */
@media (max-width: 576px) {
    .ud-hero { padding: 34px 0 26px; }

    .ud-breadcrumb { font-size: 12px; margin-bottom: 18px; }

    .ud-identity { gap: 14px; }
    .ud-logo     { width: 62px; height: 62px; padding: 7px; }
    .ud-name     { font-size: 21px; }
    .ud-location { font-size: 14px; }

    .ud-chip { font-size: 12px; padding: 6px 12px; }

    .ud-hero-actions { gap: 10px; margin-top: 22px; }

    .ud-btn {
        flex: 1 1 100%;
        justify-content: center;
        padding: 12px 18px;
        font-size: 13px;
    }

    .ud-btn-apply:hover,
    .ud-btn-ghost:hover { transform: none; box-shadow: none; }

    .ud-tabs { gap: 20px; }
    .ud-tab  { font-size: 13px; padding: 14px 0; }

    .ud-block { padding: 20px; border-radius: 10px; }
    .ud-block-title { font-size: 19px; }
    .ud-lead    { font-size: 15px; }
    .ud-content { font-size: 15px; line-height: 1.75; }

    .ud-facilities { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .ud-facility   { padding: 12px; }
    .ud-facility:hover { transform: none; box-shadow: none; }

    .ud-steps li { padding-left: 44px; }
    .ud-card { padding: 20px; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    .ud-btn, .ud-facility, .ud-inline-btn, .ud-card-btn, .ud-tab::after {
        transition: none;
    }

    .ud-btn:hover, .ud-facility:hover, .ud-inline-btn:hover { transform: none; }
}

/* =========================================================
   CKEDITOR TABLES INSIDE .ud-content   (v3 — fully responsive)

   Desktop : styled table, full width
   Tablet  : horizontal scroll with fade hint
   Mobile  : rows stack into cards, no scrolling at all

   ========================================================= */

/* ---------- WRAPPER ---------- */
.ud-content figure.table,
.ud-content .ud-table-wrap {
    display: block !important;
    width: 100% !important;
    position: relative;
    margin: 26px 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: 0 6px 22px rgba(0, 56, 99, .10);
}

.ud-content figure.table::-webkit-scrollbar,
.ud-content .ud-table-wrap::-webkit-scrollbar { height: 6px; }

.ud-content figure.table::-webkit-scrollbar-thumb,
.ud-content .ud-table-wrap::-webkit-scrollbar-thumb {
    background: #c4d2de;
    border-radius: 10px;
}

.ud-content figure.table::-webkit-scrollbar-track,
.ud-content .ud-table-wrap::-webkit-scrollbar-track {
    background: #f0f4f8;
    border-radius: 10px;
}

/* ---------- TABLE ---------- */
.ud-content table {
    width: 100% !important;
    min-width: 480px;
    max-width: none !important;
    margin: 0;
    display: table !important;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    font-size: 15px;
    overflow: hidden;
    border-radius: 12px;
}

/* ---------- HEADER ---------- */
.ud-content table thead th,
.ud-content table tbody tr:first-child th {
    background: linear-gradient(135deg, #003863 0%, #0b5a95 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    text-align: left;
    padding: 15px 18px;
    border: none;
    white-space: nowrap;
}

.ud-content table thead th + th,
.ud-content table tbody tr:first-child th + th {
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, .18);
}

/* ---------- CELLS ---------- */
.ud-content table td {
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid #e9eef3;
    color: #444;
    line-height: 1.6;
    vertical-align: middle;
}

.ud-content table tbody tr { transition: background .2s ease; }
.ud-content table tbody tr:last-child td { border-bottom: none; }

.ud-content table td a      { color: #0b82d0; font-weight: 600; }
.ud-content table td strong { color: #003863; }

/* ---------- MODE A: KEY / VALUE (no <th>) ---------- */
.ud-content table.is-kv td:first-child {
    width: 34%;
    background: #f4f8fb;
    color: #003863;
    font-weight: 700;
    font-size: 14.5px;
    border-right: 1px solid #e3ebf2;
    position: relative;
}

/* thin accent bar on the label column */
.ud-content table.is-kv td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background .2s ease;
}

.ud-content table.is-kv tr:hover td:first-child::before { background: #e8500f; }
.ud-content table.is-kv tr:hover td:first-child { background: #e9f2f9; }
.ud-content table.is-kv tr:hover td:last-child  { background: #f8fbfd; }

/* ---------- MODE B: DATA TABLE (has <th>) ---------- */
.ud-content table.is-data tbody tr:nth-child(even) td { background: #f8fafc; }
.ud-content table.is-data tbody tr:hover td           { background: #eaf4fc; }
.ud-content table.is-data tbody td:first-child        { font-weight: 600; color: #003863; }

/* ---------- CAPTION ---------- */
.ud-content figure.table figcaption {
    padding: 11px 16px;
    background: #f3f6f9;
    font-size: 13px;
    color: #667;
    text-align: center;
}

/* ---------- SCROLL HINT (tablet only) ---------- */
.ud-table-scroll-hint::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 46px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, .96));
    border-radius: 0 12px 12px 0;
    transition: opacity .25s ease;
}

.ud-table-scroll-hint.is-end::after { opacity: 0; }

.ud-table-note {
    display: none;
    font-size: 12px;
    color: #9aa5b1;
    margin: -18px 0 24px;
}

.ud-table-note i { margin-right: 5px; }

/* =========================================================
   TABLET — scroll instead of squash
   ========================================================= */
@media (max-width: 991px) and (min-width: 768px) {
    .ud-content table    { font-size: 14px; min-width: 460px; }
    .ud-content table td { padding: 12px 15px; }

    .ud-content table thead th,
    .ud-content table tbody tr:first-child th { font-size: 12.5px; padding: 13px 15px; }

    .ud-table-note { display: block; }
}

/* =========================================================
   MOBILE — STACKED CARDS, NO SCROLLING
   ========================================================= */
@media (max-width: 767px) {

    /* the wrapper stops being a scroller */
    .ud-content figure.table,
    .ud-content .ud-table-wrap {
        overflow: visible;
        box-shadow: none;
        border-radius: 0;
        margin: 20px 0;
    }

    .ud-table-scroll-hint::after { display: none; }
    .ud-table-note               { display: none; }

    /* tear the table apart into blocks */
    .ud-content table,
    .ud-content table tbody,
    .ud-content table tr,
    .ud-content table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .ud-content table {
        background: none;
        border-radius: 0;
        box-shadow: none;
        font-size: 14px;
    }

    /* header row is redundant once labels move inline */
    .ud-content table thead,
    .ud-content table.is-data tbody tr:first-child:has(th) {
        display: none !important;
    }

    /* each row becomes a card */
    .ud-content table tr {
        background: #fff;
        border: 1px solid #e6edf3;
        border-left: 3px solid #003863;
        border-radius: 10px;
        margin-bottom: 12px;
        overflow: hidden;
        box-shadow: 0 3px 12px rgba(0, 56, 99, .07);
    }

    .ud-content table tr:last-child { margin-bottom: 0; }

    /* ---- MODE A: key / value ---- */
    .ud-content table.is-kv td {
        padding: 0;
        border: none;
    }

    .ud-content table.is-kv td:first-child {
        width: 100% !important;
        background: #f4f8fb;
        border-right: none;
        border-bottom: 1px solid #e6edf3;
        padding: 10px 14px;
        font-size: 12px;
        letter-spacing: .5px;
        text-transform: uppercase;
    }

    .ud-content table.is-kv td:first-child::before { display: none; }

    .ud-content table.is-kv td:last-child {
        padding: 12px 14px;
        font-size: 14.5px;
        color: #333;
    }

    .ud-content table.is-kv tr:hover td:first-child,
    .ud-content table.is-kv tr:hover td:last-child { background: inherit; }

    /* ---- MODE B: data table — label comes from data-label ---- */
    .ud-content table.is-data td {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 14px;
        padding: 11px 14px;
        border-bottom: 1px dashed #eef2f6;
        background: #fff !important;
        text-align: right;
    }

    .ud-content table.is-data td:last-child { border-bottom: none; }

    .ud-content table.is-data td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: .5px;
        text-transform: uppercase;
        color: #7d8b99;
    }

    /* first cell reads as the card title */
    .ud-content table.is-data td:first-child {
        display: block !important;
        background: #f4f8fb !important;
        text-align: left;
        padding: 11px 14px;
        font-size: 14.5px;
        font-weight: 700;
        color: #003863;
        border-bottom: 1px solid #e6edf3;
    }

    .ud-content table.is-data td:first-child::before { display: none; }

    .ud-content table.is-data tbody tr:hover td { background: #fff !important; }
    .ud-content table.is-data tbody tr:hover td:first-child { background: #f4f8fb !important; }
}

@media (max-width: 400px) {
    .ud-content table.is-data td {
        flex-direction: column;
        gap: 3px;
        text-align: left;
    }

    .ud-content table.is-data td::before { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ud-content table tbody tr,
    .ud-content table.is-kv td:first-child::before { transition: none; }
}