/* =========================================
   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;

}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   2. Header Section
   ========================================= */
.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 60px 0;
    margin-bottom: 50px;
    text-align: center;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

.product-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
    border: 1px solid #dbeafe;
}

.page-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* =========================================
   3. Loading & States
   ========================================= */
.state-container {
    text-align: center;
    padding: 80px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.btn-retry {
    margin-top: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-retry:hover {
    background: var(--primary-dark);
}

.hidden {
    display: none !important;
}

/* =========================================
   4. Timeline Layout
   ========================================= */
.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;
    
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 20px;

    
}

.rich-editor{
    ul{
        margin-left:20px;
    }

    ol{
        margin-left:7px;
    }

    a{
        color: var(--primary-color);
        font-weight: 600;
        transition: color 0.2s;
    }
    a:hover{
        color: var(--primary-dark);
    }

    pre{
        background-color: #f1f5f9;
        padding:12px;
        border-radius:6px;
        overflow-x:auto;
    }

    blockquote{
        border-left:4px solid #cbd5e1;
        padding-left:12px;
        color: #475569;
        margin-left:0;
        margin-right:0;
        font-style: italic;
        margin-bottom: 12px;
    }
}

/* Badges */
.release-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.2s;
}

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

.tag-major,
.tag-revolutionary {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.tag-security,
.tag-emergency {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tag-minor,
.tag-stability {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.tag-default {
    background: #e2e8f0;
    color: #475569;
}

/* --- Right Content Card --- */
.entry-content {
    background: var(--bg-card);
   
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.entry-content: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-body {
    padding: 25px 30px;
}

/* --- 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;
}

.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-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-top: 18px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.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;
    }
}