/* ============================================================================
   College Detail Page — engineering (ranking redesign, Increment 3)
   Layout follows the client mockup (banner + TOC / main / sidebar), but all
   colours come from the EXISTING site palette — the banner reuses the same
   gradient already used by ranking/irfrank pages
   (linear-gradient(135deg,#1e40af,#3b82f6)), not the mockup's navy.
   ========================================================================= */

/* ── Banner ─────────────────────────────────────────────────────────────────
   Contained (not edge-to-edge) to match the mockup: it lines up with the
   3-column body below rather than bleeding to the viewport edges. */
.college-banner {
    max-width: 1400px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.college-banner-inner {
    background: linear-gradient(258deg, #1e3a8a 0%, #1e3a8a 25%, #1e3a8a 50%, #492e17 100%); /* site redesign navy→brown banner (matches News/Contact) */
    color: var(--white, #fff);
    border-radius: 10px;
    padding: 28px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

.college-banner-main {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex: 1 1 480px;
    min-width: 0;
}

.college-banner-logo {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    background: var(--white, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--rk-orange, #f58220);
    overflow: hidden;
}

.college-banner-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.college-banner-info {
    min-width: 0;
}

.college-banner-title {
    margin: 0 0 4px;
    font-size: 1.44rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--white, #fff);
}

.college-banner-location {
    margin: 0 0 12px;
    font-size: 0.81rem;
    opacity: 0.9;
}

/* Badges */
.college-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-approval {
    border-color: rgba(255, 255, 255, 0.85);
}

/* Rating + rank strip */
.college-banner-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.banner-rating {
    display: flex;
    flex-direction: column;
}

.rating-value {
    font-size: 1.44rem;
    font-weight: 700;
    line-height: 1.1;
}

.rating-stars {
    letter-spacing: 2px;
}

.rating-count {
    font-size: 0.72rem;
    opacity: 0.9;
}

.banner-rank-group {
    display: flex;
    gap: 22px;
}

.banner-rank {
    display: flex;
    flex-direction: column;
}

.rank-num {
    font-size: 1.03rem;
    font-weight: 700;
}

.rank-label {
    font-size: 0.63rem;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Action buttons */
.college-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 220px;
}

.btn-banner {
    display: block;
    padding: 10px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--white, #fff);
    font-size: 0.77rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: var(--transition, all 0.3s ease);
}

.btn-banner:hover {
    background: rgba(255, 255, 255, 0.28);
}

.btn-banner-primary {
    background: var(--white, #fff);
    color: var(--rk-orange, #f58220);
    border-color: var(--white, #fff);
}

.btn-banner-primary:hover {
    background: #eef2ff;
}

/* Certificate button uses the site's secondary/green accent. */
.btn-banner-cert {
    background: var(--secondary-color, #059669);
    border-color: var(--secondary-color, #059669);
}

.btn-banner-cert:hover {
    background: var(--dark-green, #047857);
}

/* ── 3-column layout ───────────────────────────────────────────────────── */
.college-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}

/* Left: table of contents */
.college-toc {
    position: sticky;
    top: 80px;
}

.toc-card {
    background: var(--bg-white, #fff);
    border: 1px solid var(--rk-border, #E2E4E8);
    border-radius: 8px;
    padding: 16px;
}

.toc-title {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--rk-text-primary, #1F2127);
}

.toc-link {
    display: block;
    padding: 9px 0;
    border-bottom: 1px solid var(--rk-border, #E2E4E8);
    color: var(--rk-text-secondary, #525866);
    font-size: 0.81rem;
    text-decoration: none;
}

.toc-link:last-child {
    border-bottom: 0;
}

.toc-link:hover,
.toc-link.active {
    color: var(--rk-orange, #f58220);
    font-weight: 600;
}

/* Centre */
.college-main {
    min-width: 0;
}

.content-subtitle {
    margin: 22px 0 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--rk-text-primary, #1F2127);
}

.college-about {
    color: var(--rk-text-secondary, #525866);
    line-height: 1.8;
    font-size: 0.84rem;
}

.section-note {
    color: var(--rk-text-secondary, #525866);
    font-size: 0.79rem;
    line-height: 1.7;
    margin: 0 0 14px;
}

/* Key-fact tiles */
.key-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.fact-tile {
    border: 1px solid var(--rk-border, #E2E4E8);
    border-radius: 8px;
    padding: 14px;
    background: var(--bg-light, #f9fafb);
}

.fact-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--rk-text-secondary, #525866);
    margin-bottom: 6px;
}

.fact-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--rk-text-primary, #1F2127);
}

/* Courses table */
.table-scroll {
    overflow-x: auto;
}

.courses-table {
    min-width: 640px;
}

/* Stream name (first cell) — styles.css makes .rankings-table td:first-child
   big (1.125rem) + bold + BLUE (that's meant for the rank number on ranking
   pages). Here the first cell is the stream name, so tame it to normal body
   size + site ink, keeping bold for emphasis. */
.courses-table td:first-child {
    font-size: 0.9rem;
    color: var(--rk-text-primary, #1F2127);
}
.courses-table td:first-child strong {
    font-weight: 600;
}

.not-ranked {
    font-size: 0.72rem;
    color: var(--rk-text-secondary, #525866);
    font-style: italic;
}

/* Per-quota cutoff mini-table inside the Cutoff cell (General/OBC/SC/ST/EWS). */
.cutoff-quota-table {
    border-collapse: collapse;
    font-size: 0.74rem;
    min-width: 130px;
}
.cutoff-quota-table th,
.cutoff-quota-table td {
    padding: 2px 10px 2px 0;
    text-align: left;
    border: 0;
    white-space: nowrap;
}
.cutoff-quota-table th {
    font-weight: 600;
    color: var(--rk-text-secondary, #525866);
}
.cutoff-quota-table td {
    font-weight: 700;
    color: var(--rk-text-primary, #1F2127);
}

/* Disclaimer — readable body text (matches About/Get-Help copy), no washed-out
   grey-on-grey. bg removed per client feedback so the darker text reads clearly. */
.college-disclaimer {
    margin-top: 24px;
    padding: 14px 0;
    border-top: 1px solid var(--rk-border, #E2E4E8);
    color: var(--rk-text-secondary, #525866);
    font-size: 0.77rem;
    line-height: 1.7;
}

/* ── Right sidebar ─────────────────────────────────────────────────────── */
.college-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* The shared sponsored component ships its own `position: sticky` +
   max-height for the home page. Inside this sidebar that made the ad pin
   itself while the cards below scrolled underneath it. Reset it here only —
   the home page is untouched. */
.college-side .home-ad-sidebar {
    position: static;
    max-height: none;
    top: auto;
}

.college-side .sponsored-section {
    flex: none;
}

/* Let the ad list size to its content instead of a viewport-height box. */
.college-side .ads-scroll {
    max-height: none;
    overflow: visible;
}

.side-card {
    background: var(--bg-white, #fff);
    border: 1px solid var(--rk-border, #E2E4E8);
    border-radius: 8px;
    padding: 16px;
}

/* Whole-card link (Contact Us): the entire card is clickable. */
a.side-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
a.side-card-link:hover {
    border-color: var(--rk-orange, #f58220);
    box-shadow: 0 2px 10px rgba(245, 130, 32, 0.15);
    background: var(--bg-light, #f9fafb);
}
a.side-card-link .side-note { margin-bottom: 0; }

.side-title {
    margin: 0 0 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--rk-text-primary, #1F2127);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rk-border, #E2E4E8);
}

.side-note {
    font-size: 0.72rem;
    color: var(--rk-text-secondary, #525866);
    line-height: 1.6;
    margin: 0 0 12px;
}

.side-empty {
    font-size: 0.77rem;
    color: var(--rk-text-secondary, #525866);
}

/* Admission snapshot definition list */
.snapshot {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    align-items: baseline;
}

.snapshot dt {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--rk-text-secondary, #525866);
}

.snapshot dd {
    margin: 0;
    text-align: right;
    font-size: 0.79rem;
    font-weight: 600;
    color: var(--rk-text-primary, #1F2127);
}

/* Related news */
.side-news {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--rk-border, #E2E4E8);
    text-decoration: none;
}

.side-news:last-child {
    border-bottom: 0;
}

.side-news-date {
    display: block;
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--rk-text-secondary, #525866);
}

.side-news-title {
    display: block;
    font-size: 0.77rem;
    font-weight: 600;
    color: var(--rk-text-primary, #1F2127);
    line-height: 1.4;
    margin-top: 2px;
}

.side-news:hover .side-news-title {
    color: var(--rk-orange, #f58220);
}

/* Related colleges */
.side-college {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--rk-border, #E2E4E8);
    text-decoration: none;
}

.side-college:last-child {
    border-bottom: 0;
}

.side-college-logo {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 5px;
    background: var(--bg-light, #f9fafb);
    border: 1px solid var(--rk-border, #E2E4E8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.63rem;
    font-weight: 700;
    color: var(--rk-text-secondary, #525866);
}

.side-college-info {
    min-width: 0;
}

.side-college-name {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rk-orange, #f58220);
    line-height: 1.3;
}

.side-college-meta {
    display: block;
    font-size: 0.65rem;
    color: var(--rk-text-secondary, #525866);
    margin-top: 2px;
}

/* ── Reviews ───────────────────────────────────────────────────────────── */
.review-summary {
    margin-bottom: 18px;
}

.review-summary-score {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.review-avg {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--rk-text-primary, #1F2127);
    line-height: 1;
}

.review-stars {
    color: var(--secondary-color, #059669);
    letter-spacing: 2px;
}

.review-count {
    font-size: 0.77rem;
    color: var(--rk-text-secondary, #525866);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 18px 0 0;
}

.review-card {
    border: 1px solid var(--rk-border, #E2E4E8);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--bg-white, #fff);
}

.review-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.review-author {
    font-weight: 600;
    color: var(--rk-text-primary, #1F2127);
}

.review-card-rating {
    color: var(--secondary-color, #059669);
    letter-spacing: 1px;
    white-space: nowrap;
}

.review-card-score {
    color: var(--rk-text-secondary, #525866);
    font-size: 0.72rem;
    margin-left: 4px;
}

.review-text {
    margin: 0;
    color: var(--rk-text-secondary, #525866);
    font-size: 0.81rem;
    line-height: 1.7;
}

.review-date {
    margin-top: 8px;
    font-size: 0.68rem;
    color: var(--rk-text-secondary, #525866);
}

/* ── Review form ───────────────────────────────────────────────────────── */
.review-form {
    border: 1px solid var(--rk-border, #E2E4E8);
    border-radius: 8px;
    padding: 16px;
    background: var(--bg-light, #f9fafb);
}

.rating-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rating-label {
    font-size: 0.79rem;
    color: var(--rk-text-primary, #1F2127);
}

.rating-label em {
    color: #dc2626;
    font-style: normal;
}

/* Star buttons — larger & more prominent, colour reflects the selected level. */
.star-input {
    display: inline-flex;
    gap: 4px;
}

.star {
    background: none;
    border: 0;
    padding: 0 2px;
    font-size: 1.8rem;          /* larger (was 1.35rem) */
    line-height: 1;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.15s, transform 0.1s;
}

.star:hover {
    transform: scale(1.1);
}

/* Lit stars get a drop-shadow so they stand out. Colour comes from the level
   class the JS sets on the group: 1-2 red, 3-4 yellow, 5 green. */
.star-input.level-low .star.on {
    color: #dc2626;                                   /* red */
    filter: drop-shadow(0 1px 2px rgba(220, 38, 38, 0.45));
}

.star-input.level-mid .star.on {
    color: #f59e0b;                                   /* yellow/amber */
    filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.45));
}

.star-input.level-high .star.on {
    color: var(--secondary-color, #059669);           /* green */
    filter: drop-shadow(0 1px 2px rgba(5, 150, 105, 0.45));
}

/* Fallback (hover before a level is set) — neutral highlight. */
.star.on {
    color: #f59e0b;
}

/* Honeypot — must stay invisible to humans, but not display:none
   (some bots skip hidden fields). */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.form-row label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--rk-text-primary, #1F2127);
}

.form-row label em {
    color: #dc2626;
    font-style: normal;
}

.form-row input,
.form-row textarea {
    padding: 9px 10px;
    border: 1px solid var(--rk-border, #E2E4E8);
    border-radius: 6px;
    font: inherit;
    font-size: 0.79rem;
    background: var(--bg-white, #fff);
    color: var(--rk-text-primary, #1F2127);
}

.form-row input:focus,
.form-row textarea:focus {
    outline: 2px solid var(--rk-orange, #f58220);
    outline-offset: 1px;
    border-color: var(--rk-orange, #f58220);
}

.form-row textarea {
    resize: vertical;
}

/* Inline field validation (rules mirror the server's) */
.form-row input.has-error,
.form-row textarea.has-error {
    border-color: #dc2626;
}

.form-row input.has-error:focus,
.form-row textarea.has-error:focus {
    outline-color: #dc2626;
}

.field-error {
    font-size: 0.68rem;
    color: #b91c1c;
}

.form-message {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.77rem;
}

.form-message.is-success {
    background: var(--light-green, #d1fae5);
    color: var(--dark-green, #047857);
}

.form-message.is-error {
    background: #fee2e2;
    color: #b91c1c;
}

#reviewSubmitBtn {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 10px 20px;
}

#reviewSubmitBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Dummy-data marker ─────────────────────────────────────────────────────
   Anything still awaiting real client data is wrapped in .dummy-data and
   suffixed "(#)" so it's unmistakable in review. Remove the wrapper once the
   real data lands. */
.dummy-data {
    color: #92400e;
    background: #fef3c7;
    padding: 0 4px;
    border-radius: 3px;
    font-style: italic;
}

/* Keep the marker readable on the dark banner. */
.college-banner .dummy-data {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .college-layout {
        grid-template-columns: 190px minmax(0, 1fr);
    }
    .college-side {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .college-side > * {
        flex: 1 1 280px;
    }
}

@media (max-width: 768px) {
    .college-layout {
        grid-template-columns: 1fr;
        padding: 16px 12px 32px;
    }
    .college-toc {
        position: static;
    }
    .college-banner-actions {
        flex: 1 1 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .college-banner-actions .btn-banner {
        flex: 1 1 140px;
    }
    .college-banner-title {
        font-size: 1.12rem;
    }
}
