/**
 * Changelog-specific styles
 */

/* Override primary color to match green theme */
:root {
    --primary-color: #4CAF50;
}

html.dark-mode body {
    --primary-color: #4CAF50;
}

/* Header content styling */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
}

/* Icon indicators for buttons */
.changelog-btn[href="changelog.html"]::after {
    content: '📋';
    font-size: 0.8rem;
}

.changelog-btn[href="index.html"]::after {
    content: '🔙';
    font-size: 0.8rem;
}

/* Dark mode enhancements */
.dark-mode .changelog-btn {
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.dark-mode .changelog-btn:hover {
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.35);
}

/* Focus states for accessibility */
.changelog-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.dark-mode .changelog-btn:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.4);
}

/* Button entrance animation */
@keyframes buttonFadeIn {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.changelog-btn {
    animation: buttonFadeIn 0.5s ease-out;
}

.changelog-btn {
    padding: 0.6rem 1.2rem;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid #4CAF50;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
    position: absolute;
    right: 0;
    overflow: hidden;
}

.changelog-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.changelog-btn:hover {
    background: #45a049;
    border-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.25);
}

.changelog-btn:hover::before {
    left: 100%;
}

.changelog-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

/* Changelog container */
.changelog-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

.changelog-intro {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.changelog-intro p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* Changelog entries */
.changelog-entries {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.changelog-entry {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.changelog-entry:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

/* Accordion button */
.accordion-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.2s ease;
    text-align: left;
}

.accordion-btn:hover {
    background: var(--hover-bg);
}

.accordion-btn[aria-expanded="true"] {
    background: var(--primary-color);
    color: white;
}

.accordion-date {
    font-size: 1.2rem;
}

.accordion-arrow {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.accordion-btn[aria-expanded="true"] .accordion-arrow {
    transform: rotate(180deg);
}

/* Accordion content */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.open {
    max-height: 5000px; /* Much larger to accommodate all content */
    transition: max-height 0.5s ease-in;
}

.changelog-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.changelog-content h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.changelog-content p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Point changes styling */
.point-changes {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.changes-section h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.changes-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.5rem;
}

.change-item {
    padding: 0.6rem;
    background: var(--hover-bg);
    border-radius: 6px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.9rem;
    color: var(--text-color);
    border-left: 4px solid #4CAF50;
    font-weight: 400;
    line-height: 1.5;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    min-height: auto;
}

.change-item:hover {
    transform: translateX(2px);
    border-left-color: #45a049;
}

/* Enhanced number styling for better readability */
.change-item .old-value {
    color: #dc3545;
    font-weight: 600;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
}

.change-item .new-value {
    color: #4CAF50;
    font-weight: 600;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
}

.change-item .arrow {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Card name styling */
.change-item .card-name {
    flex: 1 1 auto;
    font-weight: 500;
    color: var(--text-color);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Point changes container */
.change-item .point-changes {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    white-space: nowrap;
    gap: 0;
}

/* Remove all margins and gaps for tight spacing */
.change-item .point-changes .old-value,
.change-item .point-changes .arrow,
.change-item .point-changes .new-value {
    margin: 0;
    padding: 2px 4px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.change-item .point-changes .arrow {
    padding: 0 2px;
    font-size: 0.9rem;
}

/* Create proper spacing between card name and point changes */
.change-item {
    gap: 0.8rem;
}

/* Ensure card name takes available space */
.change-item .card-name {
    flex: 1 1 auto;
    text-align: left;
}

/* Dark mode specific adjustments */
.dark-mode .changelog-entry {
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

.dark-mode .changelog-entry:hover {
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.dark-mode .change-item {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .change-item .old-value {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

.dark-mode .change-item .new-value {
    color: #69db7c;
    background: rgba(105, 219, 124, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .changelog-btn {
        position: static;
        margin-top: 0.5rem;
    }
    
    .changelog-container {
        padding: 0.5rem;
    }
    
    .accordion-btn {
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
    }
    
    .accordion-date {
        font-size: 1.1rem;
    }
    
    .changelog-content {
        padding: 1rem;
    }
    
    .changes-list {
        grid-template-columns: 1fr;
    }
    
    .change-item {
        font-size: 0.85rem;
    }
    
    /* Ensure accordion content shows fully on mobile */
    .accordion-content.open {
        max-height: 10000px; /* Very large value for mobile to show all content */
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.3rem;
    }
    
    .changelog-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        position: static;
    }
}