:root {
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-light: #e2e8f0;
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --purple: #7c3aed;
    --purple-light: #f5f3ff;
    --rose: #e11d48;
    --rose-light: #fff1f2;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-hover: 0 12px 20px -5px rgb(0 0 0 / 0.05), 0 4px 8px -4px rgb(0 0 0 / 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 13px;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Ambient Background */
.ambient-bg {
    position: fixed;
    top: 0; left: 0; right: 0; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-body);
}
.ambient-bg::before, .ambient-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}
.ambient-bg::before {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(219,234,254,1) 0%, rgba(255,255,255,0) 70%);
}
.ambient-bg::after {
    bottom: -10%; right: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(243,232,255,1) 0%, rgba(255,255,255,0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.4rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
}

.nav-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.brand-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}

.brand-version {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
    margin-left: 4px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem;
}

/* Hero Section — compact for embedded view */
.hero {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fade-in-up 0.8s ease-out forwards;
}

.hero h1 {
    font-size: 1.75rem;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Timeline and Version Blocks */
.timeline-container {
    position: relative;
    padding-left: 16px;
}

.version-block {
    margin-bottom: 2rem;
    position: relative;
}

/* Vertical line connecting versions */
.version-block::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 30px;
    bottom: -20px;
    width: 2px;
    background: var(--border-light);
    z-index: 0;
}

/* Hide the line after the last item */
.version-block:last-child::before {
    display: none;
}

.version-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
    padding-top: 2px;
}

.version-header::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 12px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    z-index: 1;
}

.version-header h2 {
    font-size: 1.4rem;
    color: var(--text-main);
}

.version-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    background: white;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

/* Category filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 1.75rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-count {
    font-size: 0.7rem;
    opacity: 0.7;
}

.filter-btn.active .filter-count {
    opacity: 0.85;
}

/* Anything the active filter excludes */
.filtered-out {
    display: none !important;
}

/* Month grouping inside a version */
.month-group {
    margin-bottom: 1.25rem;
}

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

.month-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
}

.month-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.month-header::after {
    content: '';
    order: 2;
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.month-count {
    order: 3;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.75;
    white-space: nowrap;
}

/* Grid for cards */
.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

/* Cards */
.update-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
}

.update-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.update-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.2);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.icon-feat { background: var(--success-light); color: var(--success); }
.icon-report { background: var(--purple-light); color: var(--purple); }
.icon-improve { background: var(--primary-light); color: var(--primary); }
.icon-fix { background: var(--warning-light); color: var(--warning); }
.icon-integ { background: var(--rose-light); color: var(--rose); }

.card-title-group {
    flex-grow: 1;
}

.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.badge-feat { background: var(--success-light); color: var(--success); }
.badge-report { background: var(--purple-light); color: var(--purple); }
.badge-improve { background: var(--primary-light); color: var(--primary); }
.badge-fix { background: var(--warning-light); color: var(--warning); }
.badge-integ { background: var(--rose-light); color: var(--rose); }

.update-card h3 {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}

.update-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.45rem 0.9rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.2s ease;
    align-self: flex-start;
}

.download-link:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.navbar .download-link {
    margin-top: 0;
}

/* Feature Image Placeholder */
.feature-image {
    margin-top: auto;
    border-radius: var(--radius-sm);
    background-color: var(--bg-body);
    border: 1px dashed var(--border-light);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-image::before {
    content: '📷 Add Screenshot';
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    position: absolute;
    z-index: 0;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    display: block;
}

/* Hide broken image icon when src is empty */
.feature-image img[src=""] {
    opacity: 0;
}

/* List View for Older Releases */
.list-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-top: 0.5rem;
}

.list-version-group {
    margin-bottom: 1rem;
}
.list-version-group:last-child {
    margin-bottom: 0;
}

.list-version-group h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.3rem;
}

.compact-list {
    list-style: none;
    padding: 0;
}

.compact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.compact-list li strong {
    color: var(--text-main);
}

.compact-list li .badge {
    margin-bottom: 0;
    margin-top: 1px;
    flex-shrink: 0;
    width: 90px;
    text-align: center;
}

/* Animations */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 1.5rem; }
    .grid-container { grid-template-columns: 1fr; }
    .container { padding: 1rem 0.75rem; }
    .version-header h2 { font-size: 1.2rem; }
    .timeline-container { padding-left: 10px; }
    .version-block::before { left: -10px; }
    .version-header::before { left: -15.5px; }
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    animation: modalFadeIn 0.3s forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transform: scale(0.95);
    animation: modalZoomIn 0.3s forwards;
}

@keyframes modalZoomIn {
    from { transform: scale(0.95); }
    to { transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #f1f1f1;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: 0.2s;
}

.modal-close:hover {
    color: #fff;
    transform: scale(1.1);
}

.feature-image img:not([src=""]) {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.feature-image img:not([src=""]):hover {
    transform: scale(1.02);
}
