/* Changelog Styles - Refined "Cursor-style" */

/* Override global overflow to fix sticky positioning */
body.changelog-page {
    overflow-x: visible;
    overflow-y: visible;
}

/* Ensure HTML also allows it if necessary, though CSS classes apply to body usually. 
   If html has overflow, sticking might still fail. 
   We can't easily target html via a body class, but usually body overflow: hidden is the main culprit.
*/

.changelog-page-wrapper {
    padding: 2rem 2rem 8rem 2rem;
    max-width: 1500px;
    margin: 0 auto;
    margin: 0 auto;
    background-color: transparent;
}

.changelog-main-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    font-weight: 400;
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 8rem;
    /* Large gap between entries */
}

.changelog-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .changelog-item {
        grid-template-columns: 260px 1fr;
        /* Widened from 200px to fit Pill + Date */
        gap: 5rem;
        /* Increased gap for more space between date and content */
    }
}

/* Left Column: Date & Category */
.changelog-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* Center vertically */
    gap: 0.75rem;
    position: sticky;
    top: 100px;
    /* Sticky on scroll */
    height: fit-content;
    align-self: start;
    /* Critical for sticky in grid */
}

@media (max-width: 768px) {
    .changelog-meta {
        position: static;
        margin-bottom: 1rem;
    }
}

.changelog-category-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    /* Precise padding for visual centering */
    border: 1px solid #d1d5db;
    /* Light grey border */
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    /* Slightly bolder for better legibility */
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
    background: transparent;
    letter-spacing: 0.05em;
    font-family: var(--font-body);
    line-height: 1;
    /* Force tight line-height */
}

.changelog-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-family: var(--font-body);
    line-height: 1;
    /* Align centers accurately */
}

@media (prefers-color-scheme: dark) {
    .changelog-category-pill {
        border-color: rgba(255, 255, 255, 0.2);
        color: #a0a0a0;
    }

    .changelog-date {
        color: #888;
    }
}

/* Right Column: Content */
.changelog-content {
    color: var(--text-primary);
}

.changelog-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.changelog-title {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.changelog-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.changelog-body p {
    margin-bottom: 1.5rem;
}

.changelog-body h4 {
    /* Subheaders in content */
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.changelog-body ul,
.changelog-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.changelog-body li {
    margin-bottom: 0.5rem;
}

/* Code Blocks & Images inside content */
.changelog-body code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: var(--text-primary);
}

.changelog-body pre {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.changelog-body img {
    width: 100%;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Loader */
.changelog-loader {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    opacity: 0;
    padding-bottom: 4rem;
    transition: opacity 0.3s;
}

.changelog-loader.visible {
    opacity: 1;
}

.loader-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 196, 0, 0.3);
    border-radius: 50%;
    border-top-color: #FFC400;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-color-scheme: dark) {
    .changelog-body code {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
}

/* Accordion Styles */
.changelog-accordions {
    margin-top: 3rem;
    border-top: 1px solid var(--subtle-border);
}

.changelog-accordions details {
    border-bottom: 1px solid var(--subtle-border);
}

.changelog-accordions summary {
    list-style: none;
    /* Hide default triangle */
    cursor: pointer;
    padding: 1.5rem 0;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s ease;
}

.changelog-accordions summary::-webkit-details-marker {
    display: none;
}

.changelog-accordions summary:hover {
    color: #666;
}

.changelog-accordions .chevron {
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.changelog-accordions details[open] .chevron {
    transform: rotate(180deg);
}

.changelog-accordions details ul {
    padding-bottom: 1.5rem;
    padding-left: 0;
    margin-bottom: 0;
    list-style-type: none;
}

.changelog-accordions details li {
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    position: relative;
    color: var(--text-secondary);
}

.changelog-accordions details li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
    .changelog-accordions .chevron {
        filter: invert(1);
    }
}

/* Feature Grid for Visual Highlights */
.changelog-feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (min-width: 600px) {
    .changelog-feature-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.feature-grid-item {
    background: var(--bg-color);
    border: 1px solid var(--subtle-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-grid-img-placeholder {
    width: 100%;
    height: 150px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.8rem;
}

.feature-grid-caption {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mode Showcase Styles - Full Width Blocks */
.changelog-mode-showcase {
    margin: 4rem 0;
}

.mode-block {
    margin-bottom: 5rem;
}

.mode-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mode-image-placeholder {
    width: 100%;
    height: auto;
    min-height: 300px;
    background: #f0f0f0;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: block;
    color: #888;
    border: 1px solid var(--subtle-border);
}

.mode-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

@media (prefers-color-scheme: dark) {
    .mode-image-placeholder {
        background: #1a1a1a;
        color: #555;
        border-color: #333;
    }
}

/* Coming Soon Section Styles */
.coming-soon-container {
    margin-top: 2rem;
    background: rgba(0, 0, 0, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--subtle-border, #e0e0e0);
}

.coming-soon-header {
    margin-top: 0;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.coming-soon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.coming-soon-card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--subtle-border, #e0e0e0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.coming-soon-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.coming-soon-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary, #333);
    font-weight: 600;
}

.coming-soon-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    line-height: 1.5;
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    .coming-soon-container {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .coming-soon-card {
        background: rgba(30, 30, 30, 0.6);
        border-color: rgba(255, 255, 255, 0.05);
        box-shadow: none;
    }

    .coming-soon-card-title {
        color: #e0e0e0;
    }

    .coming-soon-desc {
        color: #888;
    }
}