/*
 * comparingSortAlgorithmsStyles.css
 * TNT | Duck Sorting — Comparing Sort Algorithms
 * Page-specific styles — extends ../styles/tnt-base-styles.css
 */

/* ── Hero ──────────────────────────────────────────────────────────────── */
/*
 * Same duck-photo background as duckSortingStyles.css, but slightly taller
 * (40vh vs 34vh) to give the reference-guide title room to breathe.
 * Image path is relative to THIS file (styles/), so one level up then images/.
 */
#hero {
    min-height: 40vh;
    background:
        linear-gradient(180deg, rgba(0,30,70,0.62) 0%, rgba(5,60,120,0.28) 55%, rgba(0,0,0,0.08) 100%),
        url('../images/ducksInARow.jpg') center 70% / cover no-repeat;
    padding: 3.5rem 1rem 3rem;
}

/* ── Spark bar ─────────────────────────────────────────────────────────── */
/* Identical to duckSortingStyles.css — dark band with sky-blue links. */
.spark-bar {
    background: #0c1e35;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.4rem;
    border-bottom: 1px solid rgba(26, 140, 216, 0.25);
}

.spark-bar a,
.spark-bar .spark-link {
    color: #1a8cd8;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: inherit;
}

.spark-bar a:hover,
.spark-bar .spark-link:hover {
    color: #5bc0f5;
    text-decoration: underline;
}

.spark-bar span {
    color: rgba(255, 255, 255, 0.40);
    font-size: 0.80rem;
    margin-left: auto;
}

/* ── Main content area ─────────────────────────────────────────────────── */
#mainContent {
    background-color: #f0f7fb;
    padding: 2rem 0;
}

/* ── Family section headings ───────────────────────────────────────────── */
/*
 * .family-heading — large Boogaloo display heading with a coloured left border
 * that signals which algorithm family we are in.
 */
.family-heading {
    font-family: 'Boogaloo', cursive;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    padding-left: 0.9rem;
    border-left: 5px solid transparent;
    margin-bottom: 0.75rem;
}

/* Swap-and-repeat family — Bootstrap primary blue */
.family-heading.swap {
    border-color: #0d6efd;
}

/* Pick-and-place family — Bootstrap success green */
.family-heading.place {
    border-color: #198754;
}

/* ── Algorithm cards ───────────────────────────────────────────────────── */
.algo-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-top: 4px solid transparent;   /* coloured strip added by modifier below */
}

/* Top-border colour by family */
.algo-card.swap-family {
    border-top-color: #0d6efd;   /* Bootstrap primary blue — swap-and-repeat */
}

.algo-card.place-family {
    border-top-color: #198754;   /* Bootstrap success green — pick-and-place */
}

/* ── Key-insight callout ───────────────────────────────────────────────── */
/*
 * Amber left-border box used to highlight the most important take-away
 * in each algorithm section.
 */
.key-insight {
    border-left: 4px solid #E69F4D;
    background-color: rgba(230, 159, 77, 0.10);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
}

.key-insight p:last-child {
    margin-bottom: 0;
}

/* ── Big O badges ──────────────────────────────────────────────────────── */
/*
 * Inline monospace chips that display Big O notation inline with prose,
 * styled like a dark code-editor theme so they stand out clearly.
 */
.big-o {
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: #1e1e2e;
    color: #cdd6f4;
    vertical-align: middle;
    white-space: nowrap;
}

/* ── Complexity table ──────────────────────────────────────────────────── */
.complexity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.complexity-table thead tr {
    background-color: #0a0e1a;
    color: #ffffff;
}

.complexity-table th,
.complexity-table td {
    padding: 0.55rem 0.85rem;
    text-align: left;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

/* Alternating row shading */
.complexity-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.complexity-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.complexity-table tbody tr:hover {
    background-color: #e8f2fb;
}

/* ── Complexity badge pills (in table cells) ───────────────────────────── */
/*
 * Small coloured pill badges used in the Best / Average / Worst columns
 * to make the relative complexity immediately scannable.
 */
.tc-best,
.tc-avg,
.tc-worst,
.tc-special {
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

.tc-best {
    background-color: #d1e7dd;
    color: #0a3622;
}

.tc-avg {
    background-color: #fff3cd;
    color: #5c3a00;
}

.tc-worst {
    background-color: #f8d7da;
    color: #58151c;
}

.tc-special {
    background-color: #e2e3e5;
    color: #383d41;
}

/* ── CTA box ───────────────────────────────────────────────────────────── */
/*
 * Centred call-to-action panel at the bottom of the page.
 * Uses the same amber-toned gradient as the TNT brand for warmth.
 */
.cta-box {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #c47a1e 0%, #E69F4D 60%, #f0b862 100%);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cta-box .btn-light {
    color: #6b3a00;
    font-weight: 700;
}

/* ── History blurb ─────────────────────────────────────────────────────── */
/*
 * Italicised, slightly muted paragraph used for the historical context
 * notes at the top of each algorithm section.
 */
.history-blurb {
    font-style: italic;
    font-size: 0.88rem;
    color: #5a6170;
    padding-left: 0.85rem;
    border-left: 2px solid #dee2e6;
    margin-bottom: 1rem;
}

/* ── Analogy box ───────────────────────────────────────────────────────── */
/*
 * Light-blue tinted box used for real-world analogies that make each
 * algorithm easier to picture.
 */
.analogy-box {
    background-color: rgba(13, 110, 253, 0.06);
    border: 1px solid rgba(13, 110, 253, 0.15);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
}

.analogy-box p:last-child {
    margin-bottom: 0;
}

/* ── Button width reset ────────────────────────────────────────────────── */
/*
 * A legacy style.css rule sets `button { width: 50px; }`.
 * Override it so Bootstrap and content determine button widths on this page.
 */
button {
    width: auto;
}
