/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
    /* Brand Palette */
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --accent-color: #4f46e5;

    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;

    /* Typography */
    --text-main: #0f172a;
    --text-secondary: #1b1f24;
    --text-muted: #94a3b8;

    /* UI Elements */
    --border-color: #e2e8f0;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Layout Dimensions */
    --sidebar-width: 30%;
    --gap-width: 60px;
    --line-offset: 20px;
    --dot-size: 14px;

}


.changelog-body {
    background: #F9FAFC;
}

.timeline-wrapper {
    position: relative;
    padding-bottom: 40px;
}

/* Vertical Line */
.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 0;
    left: var(--line-offset);
    width: 2px;
    background: linear-gradient(to bottom, #cbd5e1 0%, #cbd5e1 80%, transparent 100%);
    z-index: 0;
}

.changelog-entry {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--gap-width);
    margin-bottom: 80px;
    position: relative;
    padding-left: 50px;
    /* Space for the line */
    opacity: 0;
    /* Animation Start */
    animation: slideUpFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Left Sidebar (Sticky) --- */
.entry-sidebar {
    position: sticky;
    top: 160px;
    /* Top offset when scrolling */
    text-align: left;
    height: fit-content;
    z-index: 10;
}

/* Timeline Dot */
.entry-sidebar::after {
    content: '';
    position: absolute;
    /* Center dot on line: offset - left-padding - (dot/2) + border-adjustment */
    left: calc(var(--line-offset) - 50px - (var(--dot-size) / 2) + 1px);
    top: 15px;
    left: -39px;
    width: var(--dot-size);
    height: var(--dot-size);
    background: var(--bg-card);
    border: 3px solid #cbd5e1;
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 6px var(--bg-body);
    /* Creates visual gap in line */
}

/* Latest Version Dot Animation */
.changelog-entry:first-child .entry-sidebar::after {
    background: var(--primary-color);
    border-color: var(--primary-color);
    animation: pulse-dot 2s infinite;
}

/* --- Sidebar Content --- */
.version-title {
    margin-bottom: 12px;
    line-height: 1;
}

.version-title span {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text-main) 0%, #64748b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-icon {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.entry-description {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 8px;
}

.rich-text {
    font-size: 1em;
    line-height: 1.6;
    color: inherit;
}

/* Remove top margin from first rendered element */
.rich-text> :first-child {
    margin-top: 0 !important;
}

/* H1 – Main title */
.rich-text h1 {
    font-size: 1.8em;
    font-weight: 600;
    margin: 1.5em 0 0.8em;
    line-height: 1.25;
}

/* H2 – Section title */
.rich-text h2 {
    font-size: 1.55em;
    font-weight: 600;
    margin: 1.3em 0 0.7em;
    line-height: 1.3;
}

/* H3 – Subsection */
.rich-text h3 {
    font-size: 1.35em;
    font-weight: 600;
    margin: 1.2em 0 0.6em;
    line-height: 1.3;
}

/* H4 – Subtitle */
.rich-text h4 {
    font-size: 1.1em;
    font-weight: 500;
    color: #6b7280;
    margin: 1em 0 0.4em;
    line-height: 1.3;
}

/* H5, H6 (if pasted) */
.rich-text h5 {
    font-size: 1em;
    font-weight: 600;
    margin: 0.9em 0 0.4em;
}

.rich-text h6 {
    font-size: 0.95em;
    font-weight: 600;
    margin: 0.8em 0 0.3em;
}


/* Paragraphs */
.rich-text p {
    font-size: 1em;
    margin: 0.5em 0;
    line-height: 1.6;
}

/* Lists */
.rich-text ol {
    list-style-type: decimal;
    margin: 0.5em 0 0.5em 1.5em;
    padding-left: 0;
}

.rich-text ul {
    list-style-type: disc;
    margin: 0.5em 0 0.5em 1.5em;
    padding-left: 0;
}

.rich-text li {
    margin: 0.25em 0;
    line-height: 1.6;
}

/* Links */
.rich-text a {
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.2s;
}

.rich-text a:hover {
    color: #1d4ed8;
}

/* Code blocks */
.rich-text pre {
    background: #f1f5f9;
    padding: 0.75em 1em;
    border-radius: 0.375em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95em;
    line-height: 1.5;
    overflow-x: auto;
    margin: 0.75em 0;
}

/* Inline code */
.rich-text code {
    background: #f1f5f9;
    padding: 0.15em 0.35em;
    border-radius: 0.25em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95em;
    color: #d63384;
}

/* Blockquotes */
.rich-text blockquote {
    border-left: 3px solid #e5e7eb;
    padding-left: 1em;
    margin: 0.75em 0;
    color: #374151;
    font-style: italic;
}

/* Strong / emphasis */
.rich-text strong {
    font-weight: 600;
}

.rich-text em {
    font-style: italic;
}

/* Quill alignment helpers */
.rich-text .ql-align-center {
    text-align: center;
}

.rich-text .ql-align-right {
    text-align: right;
}

.rich-text .ql-align-justify {
    text-align: justify;
}

/* Quill size picker classes */
.rich-text .ql-size-small {
    font-size: 0.85em;
}

.rich-text .ql-size-large {
    font-size: 1.25em;
}

.rich-text .ql-size-huge {
    font-size: 1.6em;
}


/* Badges */
.release-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 600;

    background: var(--tag-bg, #e2e8f0);
    color: var(--tag-fg, #475569);
    border: 1px solid var(--tag-bd, #cbd5e1);
    transition: transform 0.2s;


}

.release-badge i {
    font-size: 0.95em;
}

.release-badge:hover {
    transform: translateY(-1px);
}

/* =========================
   Major / Milestone Releases
   ========================= */
.tag-major,
.tag-revolutionary {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* =========================
   Security / Critical / Emergency
   ========================= */
.tag-security,
.tag-critical,
.tag-emergency {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* =========================
   Minor / Stable / Maintenance
   ========================= */
.tag-minor,
.tag-stability,
.tag-stable,
.tag-maintenance {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* =========================
   Bugfix / Hotfix
   ========================= */
.tag-bugfix,
.tag-hotfix {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

/* =========================
   Pre-Release Channels
   ========================= */
.tag-rc {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.tag-beta {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde68a;
}

.tag-alpha {
    background: #fae8ff;
    color: #86198f;
    border: 1px solid #f5d0fe;
}

/* =========================
   Default / Unknown
   ========================= */
.tag-default {
    background: #e2e8f0;
    color: #475569;
}


/* --- Right Content Card --- */
.entry-content {

    overflow: hidden;
}

.entry-body {
    background: var(--bg-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 25px 30px;
}

.entry-body:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border-color: #cbd5e1;
}

.entry-footer {
    padding: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    justify-content: space-between;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    code {
        background: #f1f5f9;
        padding: 2px 6px;
        margin-left: -6px;
        border-radius: 4px;
        font-size: 0.85rem;
        font-family: 'Fira Code', monospace;
    }
}

/* --- Groups & Lists --- */
.change-group {
    margin-bottom: 32px;
}

.change-group:last-child {
    margin-bottom: 0;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.group-new .group-header {
    color: #059669;
}

.group-improvement .group-header {
    color: #2563eb;
}

.group-bug .group-header {
    color: #d97706;
}

.group-breaking .group-header {
    color: #dc2626;
}

.change-list {
    list-style: none;
    margin-left: 4px;
    padding: 0;
}

.change-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    transition: color 0.2s, transform 0.2s;
}

.change-item-title {
    font-weight: 600;
}

.change-item-desc {
    margin-top: 5px;
    color: var(--text-main);
}

.change-list li:hover {
    color: var(--text-main);
    transform: translateX(4px);
}

/* Custom Icons per List Item (FontAwesome Unicode) */
.change-list li::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Specific Icons based on group context */
.group-new li::before {
    content: '\f058';
    color: #059669;
}

/* Check Circle */
.group-improvement li::before {
    content: '\f061';
    color: #2563eb;
    font-size: 0.75rem;
    top: 3px;
}

/* Arrow Right */
.group-bug li::before {
    content: '\f188';
    color: #d97706;
}

/* Bug */
.group-breaking li::before {
    content: '\f071';
    color: #dc2626;
}

/* Warning */

/* =========================================
   5. Pagination & Footer
   ========================================= */
.pagination-wrapper {
    margin-top: 40px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-weight: 500;
}

.number-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn {
    padding: 0 16px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

.pagination-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.older-changelog-cta {
    margin: 25px 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.older-changelog-cta a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}

.older-changelog-cta a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Scroll To Top */
#scrollToTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--text-main);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scrollToTopBtn:hover {
    background: var(--primary-color);
    transform: translateY(-4px);
}

/* =========================================
   6. Animations
   ========================================= */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* =========================================
   7. Responsive Design
   ========================================= */
@media (max-width: 900px) {
    .container {
        padding: 0 20px;
    }

    .timeline-wrapper::before {
        display: none;
    }

    .changelog-entry {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-left: 0;
        margin-bottom: 60px;
    }

    .entry-sidebar {
        position: static;
        width: 100%;
        margin-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
    }

    .entry-sidebar::after {
        display: none;
    }

    .version-title span {
        font-size: 1.75rem;
    }

    .entry-description {
        border-left: none;
        padding-left: 0;
    }

    .entry-body {
        padding: 25px;
    }

    .page-header {
        padding: 40px 0;
    }

    .page-header h1 {
        font-size: 2rem;
    }
}