*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --border-color: #2a2a2a;
    --border-light: #333333;
    --text-primary: #e8e8e8;
    --text-secondary: #999999;
    --text-muted: #666666;
    --accent: #4ade80;
    --accent-dim: #22c55e;
    --accent-bg: rgba(74, 222, 128, 0.08);
    --red: #ef4444;
    --yellow: #eab308;
    --blue: #3b82f6;
    --purple: #a78bfa;
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --nav-height: 70px;
    --skeleton: #1a1a1a;
    --skeleton-highlight: #222222;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ===== HERO WRAPPER ===== */
.hero-wrapper {
    width: 100%;
    height: 100vh; /* Fullscreen height */
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top, rgba(74, 222, 128, 0.08) 0%, transparent 60%);
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.hero-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    pointer-events: none;
    z-index: 1;
}

.hero-wrapper .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.top-nav {
    padding: 24px 0;
    position: static;
    background: transparent;
    border: none;
    backdrop-filter: none;
    height: auto;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 100px;
}

.back-link:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: var(--accent-bg);
    transform: translateX(-4px);
}

.hero-wrapper header {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 0 120px;
    position: relative;
}

.hero-wrapper header h1 {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 16px;
    background: linear-gradient(to bottom, #fff, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-wrapper header p {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-bg);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    margin-top: 8px;
}

.changelog-nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    transition: all 0.2s;
}

.changelog-nav-link:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: var(--accent-bg);
    transform: translateY(-2px);
}

/* ===== CHANGELOG SECTION ===== */
.changelog-section {
    padding: 60px 0 100px;
    display: flex;
    flex-direction: column;
}

/* ===== CONTROLS (SEARCH & FILTER) ===== */
.changelog-controls {
    margin-bottom: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 20px;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

.search-box input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 14px 16px 14px 52px;
    border-radius: 100px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.1);
}

.filter-box {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.filter-btn.active {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent-dim);
}

@media (max-width: 992px) {
    .changelog-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 40px;
        padding: 16px;
    }
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.changelog-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.changelog-item:nth-child(1) { animation-delay: 0.1s; }
.changelog-item:nth-child(2) { animation-delay: 0.2s; }
.changelog-item:nth-child(3) { animation-delay: 0.3s; }
.changelog-item:nth-child(4) { animation-delay: 0.4s; }

.changelog-item:hover {
    border-color: rgba(74, 222, 128, 0.4);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.5);
}

.changelog-item.open {
    border-color: var(--accent-dim);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.05);
}

.changelog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    cursor: pointer;
    user-select: none;
}

.changelog-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.changelog-toggle {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.changelog-item.open .changelog-toggle {
    transform: rotate(90deg);
}

.changelog-version {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text-primary);
}

.changelog-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(74, 222, 128, 0.1);
    color: var(--accent);
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.changelog-tag.hotfix { background: rgba(239, 68, 68, 0.1); color: var(--red); border-color: rgba(239, 68, 68, 0.15); }
.changelog-tag.major { background: rgba(167, 139, 250, 0.1); color: var(--purple); border-color: rgba(167, 139, 250, 0.15); }
.changelog-tag.patch { background: rgba(59, 130, 246, 0.1); color: var(--blue); border-color: rgba(59, 130, 246, 0.15); }
.changelog-tag.minor { background: rgba(234, 179, 8, 0.1); color: var(--yellow); border-color: rgba(234, 179, 8, 0.15); }

.changelog-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.changelog-header-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.copy-version-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.copy-version-btn:hover {
    opacity: 1;
    color: var(--accent);
    background: var(--accent-bg);
}

.changelog-header-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    opacity: 0.8;
    transition: all 0.2s;
}

.changelog-header-link:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.changelog-header-link img {
    width: 16px;
    height: 16px;
}

.changelog-body {
    display: none;
    padding: 0 24px 24px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.01), transparent);
}

.changelog-item.open .changelog-body {
    display: block;
}

.changelog-body-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.changelog-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.changelog-stats-detailed {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-badge:hover {
    transform: scale(1.05);
}

.stat-badge img {
    width: 14px;
    height: 14px;
    opacity: 0.9;
}

.stat-badge.mr {
    background: rgba(27, 217, 106, 0.08);
    border-color: rgba(27, 217, 106, 0.2);
    color: #1bd96a;
}

.stat-badge.cf {
    background: rgba(241, 100, 54, 0.08);
    border-color: rgba(241, 100, 54, 0.2);
    color: #f16436;
}

.stat-badge.mr:hover {
    background: rgba(27, 217, 106, 0.15);
    border-color: #1bd96a;
    box-shadow: 0 0 15px rgba(27, 217, 106, 0.2);
}

.stat-badge.cf:hover {
    background: rgba(241, 100, 54, 0.15);
    border-color: #f16436;
    box-shadow: 0 0 15px rgba(241, 100, 54, 0.2);
}

.stat-badge.mr img, .stat-badge.cf img {
    opacity: 0.9;
}

.stat-badge:hover img {
    opacity: 1;
}

.changelog-changes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-changes li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    position: relative;
    border-radius: 6px;
    transition: all 0.2s;
}

.changelog-changes li:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    transform: translateX(4px);
}

.changelog-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}

.category-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 6px;
    opacity: 0.8;
}

.category-title.added { color: var(--accent); }
.category-title.updated { color: var(--blue); }
.category-title.removed { color: var(--red); }
.category-title.fixed { color: var(--yellow); }


.no-changes {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    padding: 10px 0;
}

.skeleton {
    background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-highlight) 50%, var(--skeleton) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-item {
    height: 60px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
}


/* ===== FOOTER ===== */
footer {
    padding: 60px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.copyright {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-legal {
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.6;
}

@media (max-width: 768px) {
    footer {
        padding: 40px 0;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== UTILITY ===== */
.loading {
    text-align: center;
    padding: 80px 0;
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--accent-bg);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 40px;
    color: var(--red);
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: var(--radius);
}

.mono { font-family: var(--mono); }

.no-results {
    text-align: center;
    padding: 60px 0;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.back-to-top svg {
    transition: transform 0.3s ease;
}

.back-to-top:hover svg {
    transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-wrapper {
        height: 100vh; /* Stay fullscreen on mobile if desired, or set to auto if content overflows */
        min-height: 600px;
    }

    .hero-wrapper header {
        padding: 40px 0 80px;
    }

    .hero-wrapper header h1 {
        font-size: 40px;
    }
    
    .hero-actions {
        gap: 8px;
    }

    .changelog-nav-link {
        font-size: 12px;
        padding: 8px 16px;
    }

    .changelog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 20px;
    }

    .changelog-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .changelog-body {
        padding: 0 20px 24px;
    }
}
