/* ==============================================
   WHAT'S NEW PAGE
   ============================================== */

.changelog-section {
    flex: 1;
    width: 100%;
}

/* Content Grid: Sidebar + List */
.changelog-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 60px;
}

@media (max-width: 1024px) {
    .changelog-content {
        grid-template-columns: 200px 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .changelog-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ==============================================
   SIDEBAR: Category Filters
   ============================================== */

.changelog-sidebar {
    position: sticky;
    top: 100px;
    z-index: 10;
}

/* Mobile Filter Toggle (hidden on desktop) */
.filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background-color: rgba(18, 18, 18, 0.6);
    border: 1px solid rgba(38, 38, 38, 0.8);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-toggle:hover {
    background-color: rgba(28, 28, 28, 0.8);
    border-color: rgba(48, 48, 48, 1);
}

.filter-toggle svg {
    color: var(--text-secondary);
}

.active-filter-count {
    margin-left: auto;
    background-color: var(--color-primary);
    color: var(--color-black);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .filter-toggle {
        display: flex;
    }
    
    .changelog-sidebar {
        position: relative;
        top: 0;
    }
}

/* Filter Drawer */
.filter-drawer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.filter-header h4 {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.filter-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.filter-close:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .filter-drawer {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60vh;
        max-height: 500px;
        background-color: var(--bg-dark);
        z-index: 1001;
        padding: 24px;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        border-top: 1px solid rgba(38, 38, 38, 0.8);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    }
    
    .filter-drawer.open {
        transform: translateY(0);
    }
    
    .filter-drawer::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .filter-drawer.open::before {
        opacity: 1;
        pointer-events: all;
    }
    
    .filter-header {
        display: flex;
    }
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: rgba(18, 18, 18, 0.6);
    border: 1px solid rgba(38, 38, 38, 0.8);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.category-chip:hover {
    background-color: rgba(28, 28, 28, 0.8);
    border-color: rgba(48, 48, 48, 1);
    color: var(--text-primary);
}

.category-chip:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.category-chip.active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-black);
    font-weight: 600;
}

.category-chip-count {
    margin-left: auto;
    opacity: 0.7;
    font-size: 12px;
}

/* Clear Filters Button */
.clear-filters {
    margin-top: 8px;
    padding: 8px 16px;
    background: none;
    border: 1px solid rgba(38, 38, 38, 0.8);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters:hover {
    border-color: rgba(48, 48, 48, 1);
    color: var(--text-primary);
}

/* ==============================================
   SKELETON LOADERS
   ============================================== */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        rgba(38, 38, 38, 0.3) 0%,
        rgba(58, 58, 58, 0.5) 50%,
        rgba(38, 38, 38, 0.3) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* Category Skeleton */
.category-skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-chip {
    height: 36px;
    border-radius: 6px;
    background-color: rgba(38, 38, 38, 0.3);
}

.skeleton-chip:nth-child(1) { width: 100%; }
.skeleton-chip:nth-child(2) { width: 85%; }
.skeleton-chip:nth-child(3) { width: 95%; }
.skeleton-chip:nth-child(4) { width: 75%; }

.skeleton-chip {
    background: linear-gradient(
        90deg,
        rgba(38, 38, 38, 0.3) 0%,
        rgba(58, 58, 58, 0.5) 50%,
        rgba(38, 38, 38, 0.3) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* Entry List Skeleton */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

.skeleton-entry {
    padding: 24px;
    background-color: rgba(18, 18, 18, 0.4);
    border: 1px solid rgba(38, 38, 38, 0.6);
    border-radius: 8px;
    min-height: 250px;
}

.skeleton-date,
.skeleton-title,
.skeleton-text,
.skeleton-tag {
    background: linear-gradient(
        90deg,
        rgba(38, 38, 38, 0.3) 0%,
        rgba(58, 58, 58, 0.5) 50%,
        rgba(38, 38, 38, 0.3) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 4px;
}

.skeleton-date {
    width: 140px;
    height: 13px;
    margin-bottom: 8px;
}

.skeleton-title {
    width: 120px;
    height: 20px;
    margin-bottom: 12px;
}

.skeleton-text {
    width: 100%;
    height: 15px;
    margin-bottom: 12px;
}

.skeleton-text:nth-child(3) {
    width: 100%;
}

.skeleton-text:nth-child(4) {
    width: 95%;
}

.skeleton-text:nth-child(5) {
    width: 88%;
}

.skeleton-text:nth-child(6) {
    width: 92%;
}

.skeleton-text.short {
    width: 65%;
    margin-bottom: 16px;
}

.skeleton-tags {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.skeleton-tag {
    width: 90px;
    height: 22px;
}

/* ==============================================
   CHANGELOG LIST & ENTRIES
   ============================================== */

.changelog-list-container {
    min-height: 400px;
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.changelog-entry {
    padding: 24px;
    background-color: rgba(18, 18, 18, 0.4);
    border: 1px solid rgba(38, 38, 38, 0.6);
    border-radius: 8px;
    transition: all 0.3s ease;
    scroll-margin-top: 120px;
}

.changelog-entry:hover {
    background-color: rgba(28, 28, 28, 0.6);
    border-color: rgba(48, 48, 48, 0.8);
    transform: translateY(-2px);
}

.changelog-entry:target {
    background-color: rgba(245, 245, 245, 0.05);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.entry-date {
    font-family: var(--font-secondary);
    font-size: 13px;
    color: var(--text-muted);
    /* margin-bottom: 8px; */
    display: block;
}

.entry-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.entry-title {
    font-family: var(--font-secondary);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.entry-version {
    display: inline-block;
    color: var(--text-off-white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: .9rem;
    font-family: var(--font-primary);
    margin-left: 10px;
    border: 1px solid var(--border-color-light);
}

.entry-description {
    font-family: var(--font-secondary);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.entry-description p {
    margin-bottom: 12px;
}

.entry-description p:last-child {
    margin-bottom: 0;
}

.entry-description ul,
.entry-description ol {
    margin: 12px 0;
    padding-left: 24px;
    font-family: var(--font-primary);
    font-size: .8rem;
    color: var(--text-muted);
}

.entry-description li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.entry-description li:last-child {
    margin-bottom: 0;
}

.entry-description li::before{
    content: "—";
    position: absolute;
    left: 25px;
    color: var(--text-muted);
}

.new-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    margin-left: 8px;
    background: var(--text-muted);
    border-radius: 4px;
    font-size: 12px;
    color: var(--color-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.entry-description strong {
    font-weight: 600;
}

.entry-section-heading {
    display: block;
    margin: 16px 0 8px 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.entry-section-heading:first-child {
    margin-top: 0;
}

.entry-description a {
    color: var(--color-primary);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.entry-description a:hover {
    opacity: 0.8;
}

/* Entry Tags/Categories */
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(38, 38, 38, 0.6);
}

.entry-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    font-family: var(--font-secondary);
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==============================================
   STATES: Loading, Error, Empty
   ============================================== */

.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-icon,
.empty-icon {
    color: var(--text-muted);
    margin-bottom: 24px;
    opacity: 0.5;
}

.error-state h3,
.empty-state h3 {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.error-state p,
.empty-state p {
    font-family: var(--font-secondary);
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.6;
}

.retry-button {
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: rgba(18, 18, 18, 0.6);
    border: 1px solid rgba(38, 38, 38, 0.8);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-button:hover {
    background-color: rgba(28, 28, 28, 0.8);
    border-color: rgba(48, 48, 48, 1);
}

.retry-button:active {
    transform: scale(0.98);
}

/* ==============================================
   LOAD MORE
   ============================================== */

.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.load-more-button {
    padding: 12px 32px;
    background-color: rgba(18, 18, 18, 0.6);
    border: 1px solid rgba(38, 38, 38, 0.8);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-button:hover {
    background-color: rgba(28, 28, 28, 0.8);
    border-color: rgba(48, 48, 48, 1);
}

.load-more-button:active {
    transform: scale(0.98);
}

.back-home {
    display: inline-block;
    margin-top: 60px;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.back-home:hover {
    color: var(--text-primary);
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 768px) {
    .changelog-entry {
        padding: 20px;
    }
    
    .entry-version {
        font-size: .7rem;
    }
    
    .entry-description {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .changelog-entry {
        padding: 16px;
    }
    
    .entry-version {
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ==============================================
   ACCESSIBILITY
   ============================================== */

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
}

.fade-in-up:nth-child(1) { transition-delay: 0.1s; }
.fade-in-up:nth-child(2) { transition-delay: 0.2s; }
.fade-in-up:nth-child(3) { transition-delay: 0.3s; }
.fade-in-up:nth-child(4) { transition-delay: 0.4s; }
.fade-in-up:nth-child(5) { transition-delay: 0.5s; }
.fade-in-up:nth-child(6) { transition-delay: 0.6s; }
.fade-in-up:nth-child(7) { transition-delay: 0.7s; }
.fade-in-up:nth-child(8) { transition-delay: 0.8s; }

.category-chip:focus-visible,
.retry-button:focus-visible,
.load-more-button:focus-visible,
.clear-filters:focus-visible,
.filter-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .changelog-entry:hover {
        transform: none;
    }
}
@media (prefers-contrast: high) {
    .category-chip,
    .changelog-entry,
    .retry-button,
    .load-more-button {
        border-width: 2px;
    }
}
