/* ═══════════════════════════════════════════════════════
   CHANGELOG — Mission Update Log
   ═══════════════════════════════════════════════════════ */

.changelog-container {
    max-width: clamp(700px, 80vw, 1600px);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.changelog-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.changelog-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-primary);
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
}

.changelog-subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.changelog-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.changelog-stat {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.changelog-stat-value {
    color: var(--status-green);
    font-weight: 600;
}

/* ─── Timeline ───────────────────────────────────────── */
.changelog-timeline {
    position: relative;
    padding-left: 2rem;
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--status-green), var(--border), transparent);
}

/* ─── Entry ──────────────────────────────────────────── */
.changelog-entry {
    position: relative;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.changelog-entry::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.9rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--status-green);
    z-index: 1;
    transition: all 0.3s ease;
}

.changelog-entry:hover::before {
    background: var(--status-green);
    box-shadow: 0 0 8px var(--status-green-glow);
}

.changelog-entry-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
    transition: all 0.3s ease;
}

.changelog-entry:hover .changelog-entry-card {
    border-color: var(--status-green-dim);
    background: var(--bg-panel-hover);
}

/* ─── Entry Header ───────────────────────────────────── */
.changelog-entry-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.changelog-version {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--status-green);
    letter-spacing: 1px;
    font-weight: 700;
}

.changelog-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid;
}

.changelog-badge.feature {
    color: var(--status-green);
    border-color: var(--status-green-dim);
    background: rgba(0, 204, 51, 0.08);
}

.changelog-badge.fix {
    color: var(--warning);
    border-color: var(--mil-red-dim);
    background: rgba(201, 162, 39, 0.08);
}

.changelog-badge.release {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: rgba(208, 208, 208, 0.08);
}

.changelog-badge.security {
    color: var(--danger);
    border-color: rgba(255, 45, 45, 0.3);
    background: rgba(255, 45, 45, 0.08);
}

.changelog-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-left: auto;
}

/* ─── Grouped Date Header ────────────────────────────── */
.changelog-date-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.changelog-date-header:hover {
    border-bottom-color: var(--status-green-dim);
}

.changelog-date-header .changelog-date {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--status-green);
    letter-spacing: 2px;
    font-weight: 700;
    margin-left: 0;
}

.changelog-version-range {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.changelog-date-summary {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-left: auto;
}

/* ─── Toggle Arrow ───────────────────────────────────── */
.changelog-toggle-arrow {
    font-size: 0.65rem;
    color: var(--status-green);
    transition: transform 0.3s ease;
    display: inline-block;
    width: 0.8rem;
    flex-shrink: 0;
}

.changelog-entry:not(.collapsed) .changelog-toggle-arrow {
    transform: rotate(90deg);
}

/* ─── Collapsible Content ────────────────────────────── */
.changelog-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 1;
    margin-top: 0.75rem;
}

.changelog-entry.collapsed .changelog-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.changelog-entry.collapsed .changelog-date-header {
    border-bottom-color: transparent;
    margin-bottom: 0;
    padding-bottom: 0;
}


/* ─── Sub-entry within date group ────────────────────── */
.changelog-sub-entry {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.changelog-sub-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.changelog-sub-entry .changelog-entry-header {
    margin-bottom: 0.4rem;
    gap: 0.6rem;
}

.changelog-sub-entry .changelog-entry-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.changelog-sub-entry .changelog-changes {
    margin-top: 0.3rem;
    padding-left: 0.5rem;
}


/* ─── Change List ────────────────────────────────────── */
.changelog-changes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-changes li {
    position: relative;
    padding: 0.35rem 0 0.35rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.changelog-changes li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--status-green);
    font-size: 0.9rem;
}

/* ─── Loading ────────────────────────────────────────── */
.changelog-loading {
    text-align: center;
    padding: 4rem 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .changelog-container {
        padding: 1.5rem 1rem;
    }
    .changelog-timeline {
        padding-left: 1.5rem;
    }
    .changelog-entry::before {
        left: -1.5rem;
    }
    .changelog-entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .changelog-date {
        margin-left: 0;
    }
    .changelog-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}
