/* Version Controller Styles - BIOS Aesthetic */

/* DEPRECATED: File Info Container removed - now integrated into tree sections */
.file-info-container {
    display: none !important; /* Hidden - version info now in file sections */
}

/* DEPRECATED: File name display removed from version control bar only */
.file-info-container .file-name {
    display: none !important;
}

/* Version Indicator Button - Now used in file sections */
.version-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border: var(--border-width) solid var(--border-primary);
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-interactive);
    min-width: fit-content;
    white-space: nowrap;
    box-shadow: var(--shadow-offset-small) var(--shadow-offset-small) 0 var(--shadow-primary);
    font-family: var(--font-bios);
    text-transform: uppercase;
    font-weight: bold;
}

.version-indicator:hover {
    background: var(--cta-primary);
    color: var(--text-on-white);
    border-color: var(--cta-primary);
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow-primary);
}

.version-indicator:active {
    transform: translate(0, 0);
    box-shadow: 0 0 0 var(--shadow-primary);
}

.version-text {
    font-family: var(--font-bios);
    font-weight: bold;
}

.version-arrow {
    font-size: var(--font-size-base);
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    font-weight: bold;
}

.version-arrow::before {
    content: 'i';
    font-family: var(--font-bios);
    font-size: var(--font-size-sm);
    line-height: 1;
}

.version-indicator:hover .version-arrow {
    color: var(--text-on-white);
}

/* Version Modal - 8-Bit BIOS Style */
.version-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}

.version-modal.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Content - 8-Bit Window */
.version-modal-content {
    font-family: var(--font-bios);
    background: var(--bg-secondary);
    border: var(--border-width-thick) solid var(--border-primary);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow-primary),
                0 0 32px var(--shadow-glow);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.version-modal.show .version-modal-content {
    transform: scale(1) translateY(0);
}

/* Modal Header - Retro Window Title Bar */
.version-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: var(--border-width) solid var(--border-primary);
    background: var(--bg-primary);
}

.version-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-bios);
    font-size: var(--font-size-lg);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* 8-Bit Close Button */
.version-modal-close {
    width: 40px;
    height: 40px;
    border: var(--border-width) solid var(--border-primary);
    background: var(--bg-interactive);
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    line-height: 1;
    box-shadow: var(--shadow-offset-small) var(--shadow-offset-small) 0 var(--shadow-primary);
}

.version-modal-close:hover {
    background: var(--status-error);
    border-color: var(--status-error);
    color: var(--text-primary);
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow-primary);
}

.version-modal-close:active {
    transform: translate(0, 0);
    box-shadow: 0 0 0 var(--shadow-primary);
}

/* Modal Body - Pixel Perfect */
.versions-list {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-secondary);
    min-height: 0;
}

/* Version Item */
.version-item {
    padding: var(--space-md);
    transition: all var(--transition-speed);
    border-bottom: var(--border-width) var(--border-secondary);
    margin-bottom: var(--space-xs);
    position: relative;
    font-family: var(--font-bios);
    cursor: pointer;
}

.version-item:hover {
    background: var(--bg-interactive);
    border-color: var(--border-primary);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow-primary);
}

/* Version Item Header */
.version-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.version-label {
    font-weight: 400;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: var(--font-bios);
    text-transform: uppercase;
}

.version-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-family: var(--font-bios);
}

/* Version Author */
.version-author {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    font-family: var(--font-bios);
}

/* Version Published Name */
.version-published-name {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    margin-bottom: var(--space-xs);
    font-family: var(--font-bios);
    font-style: italic;
    opacity: 0.8;
}

/* Version Description */
.version-description {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    line-height: 1.4;
    font-family: var(--font-bios);
}

/* Enhanced Changelog Formatting */
.changelog-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: var(--bg-interactive);
    border: var(--border-width) solid var(--border-primary);
}

.changelog-icon {
    font-size: var(--font-size-xl);
    line-height: 1;
}

.changelog-info {
    flex: 1;
}

.changelog-version {
    font-weight: 400;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
    font-family: var(--font-bios);
    text-transform: uppercase;
}

.changelog-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-family: var(--font-bios);
}

.changelog-section {
    margin-bottom: var(--space-md);
    background: var(--accent-primary-03);
    border: var(--border-width) solid var(--accent-primary-10);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-primary-08);
    border-bottom: var(--border-width) solid var(--accent-primary-10);
    font-weight: 400;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: var(--font-bios);
    text-transform: uppercase;
}

.section-icon {
    font-size: var(--font-size-base);
    line-height: 1;
}

.section-content {
    padding: var(--space-md);
    color: var(--text-secondary);
    line-height: 1.5;
    font-family: var(--font-bios);
}

.subsection {
    margin-bottom: var(--space-md);
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-header {
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-bios);
}

.change-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-family: var(--font-bios);
}

.change-list li {
    margin-bottom: var(--space-xs);
    line-height: 1.4;
    position: relative;
}

.change-list li:last-child {
    margin-bottom: 0;
}

.change-list li::marker {
    color: var(--accent-primary);
}

/* Enhanced change type styling */
.change-list.updated-items li::marker {
    color: var(--status-warning);
}

.change-list.removed-items li::marker {
    color: var(--status-error);
}

.change-list.added-lines li::marker {
    color: var(--accent-success-alt);
}

.change-list.modified-lines li::marker {
    color: var(--accent-warning-alt);
}

.change-list.removed-lines li::marker {
    color: var(--accent-error-secondary);
}

.line-changes-section {
    border-left: var(--border-width-thick) solid var(--accent-cyan);
}

.line-changes-section .section-header {
    background: var(--accent-cyan-10);
    border-bottom-color: var(--accent-cyan-20);
}

/* Change type indicators - removed bullet points from subsection headers */

/* Line change styling */
.added-lines li {
    border-left: var(--border-width) solid var(--accent-success-alt);
    background: var(--accent-success-10);
    padding-left: var(--space-sm);
    margin-left: calc(-1 * var(--space-sm));
}

.modified-lines li {
    border-left: var(--border-width) solid var(--accent-warning-alt);
    background: var(--accent-warning-10);
    padding-left: var(--space-sm);
    margin-left: calc(-1 * var(--space-sm));
}

.removed-lines li {
    border-left: var(--border-width) solid var(--accent-error-secondary);
    background: var(--accent-error-10);
    padding-left: var(--space-sm);
    margin-left: calc(-1 * var(--space-sm));
    text-decoration: line-through;
    opacity: 0.8;
}

.no-description {
    color: var(--text-muted);
    font-style: italic;
    font-size: var(--font-size-base);
    font-family: var(--font-bios);
}

.loading-text {
    color: var(--text-muted);
    font-style: italic;
    font-size: var(--font-size-base);
    font-family: var(--font-bios);
    animation: pulse 1.5s ease-in-out infinite;
}

.plain-description {
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    font-family: var(--font-bios);
}

/* Enhanced version item styling for changelog */
.version-item .version-description {
    max-height: none;
    overflow: visible;
}

/* Detailed Version Modal */
.version-detail-modal .version-modal-content {
    max-width: 800px;
    max-height: 90vh;
}

.version-detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-button {
    width: 40px;
    height: 40px;
    border: var(--border-width) solid var(--border-primary);
    background: var(--bg-interactive);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    font-weight: 400;
    box-shadow: var(--shadow-offset-small) var(--shadow-offset-small) 0 var(--shadow-primary);
}

.back-button:hover {
    background: var(--cta-primary);
    border-color: var(--cta-primary);
    color: var(--text-on-white);
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow-primary);
}

.back-button:active {
    transform: translate(0, 0);
    box-shadow: 0 0 0 var(--shadow-primary);
}

.version-details-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--bg-secondary);
}

.version-metadata {
    background: var(--accent-primary-05);
    border: var(--border-width) solid var(--accent-primary-10);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.metadata-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-sm);
    gap: var(--space-sm);
}

.metadata-row:last-child {
    margin-bottom: 0;
}

.metadata-label {
    font-weight: 400;
    color: var(--text-muted);
    min-width: 80px;
    font-size: var(--font-size-base);
    font-family: var(--font-bios);
    text-transform: uppercase;
}

.metadata-value {
    color: var(--text-primary);
    font-family: var(--font-bios);
    flex: 1;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 0;
    border: var(--border-width) solid var(--border-primary);
}

.detailed-changelog {
    padding: 0;
}

/* Enhanced changelog in detailed view */
.detailed-changelog .changelog-header {
    margin-bottom: var(--space-lg);
    background: var(--bg-interactive);
}

.detailed-changelog .changelog-section {
    margin-bottom: var(--space-lg);
}

.detailed-changelog .section-content {
    padding: var(--space-lg);
}

/* Version Description Section in Detailed Modal */
.version-description-section {
    margin-top: var(--space-md);
}

.version-description-section h4 {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-family: var(--font-bios);
    text-transform: uppercase;
}

.version-description-full {
    background: var(--bg-primary);
    border: var(--border-width) solid var(--border-primary);
    padding: var(--space-md);
    font-size: var(--font-size-base);
    color: var(--text-muted);
    line-height: 1.6;
    font-family: var(--font-bios);
}

.version-id {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    word-break: break-all;
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-info-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        min-width: auto;
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .file-name {
        max-width: none;
        text-align: left;
        font-size: 0.85rem;
    }
    
    .version-indicator {
        align-self: center;
        padding: 8px 12px;
    }
    
    .version-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .version-modal-header {
        padding: 12px 16px;
    }
    
    .versions-list {
        padding: 4px;
    }
    
    .changelog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .section-header {
        padding: var(--space-sm) var(--space-sm);
        font-size: var(--font-size-sm);
    }
    
    .section-content {
        padding: var(--space-sm);
    }
}

/* Scrollbar for version modal - 8-Bit Style */
.version-modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) var(--bg-canvas);
}

.version-modal-content::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

.version-modal-content::-webkit-scrollbar-track {
    background: var(--bg-canvas);
    border: var(--border-width) solid var(--border-secondary);
}

.version-modal-content::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border: var(--border-width) solid var(--bg-canvas);
}

.version-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.version-modal-content::-webkit-scrollbar-corner {
    background: var(--bg-canvas);
}

.versions-list {
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) var(--bg-canvas);
}

.versions-list::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

.versions-list::-webkit-scrollbar-track {
    background: var(--bg-canvas);
    border: var(--border-width) solid var(--border-secondary);
}

.versions-list::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border: var(--border-width) solid var(--bg-canvas);
}

.versions-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.versions-list::-webkit-scrollbar-corner {
    background: var(--bg-canvas);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Loading states */
.tree-placeholder.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--color-gray-component);
    font-size: 14px;
    text-align: center;
    min-height: 200px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-secondary);
    border-top: 2px solid var(--accent-primary-alt);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tree-placeholder.loading-state span {
    opacity: 0.8;
    font-weight: 500;
}

/* Error state improvements */
.tree-placeholder.error-state {
    background: var(--status-error-bg);
    border: 2px solid var(--status-error);
    color: var(--status-error-text);
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tree-placeholder.error-state.fatal {
    background: #3f51b5;
    border-color: #303f9f;
    color: white;
}

.tree-placeholder.error-state .error-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.tree-placeholder.error-state .error-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.tree-placeholder.error-state .error-details {
    margin: 15px 0;
    text-align: left;
    background: rgba(0,0,0,0.1);
    padding: 10px;
    border-radius: 0px;
    font-size: 0.9em;
}

.tree-placeholder.error-state .error-details p {
    margin: 5px 0;
}

.tree-placeholder.error-state .recovery-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.tree-placeholder.error-state button {
    padding: 8px 16px;
    border: none;
    border-radius: 0px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.tree-placeholder.error-state .retry-button,
.tree-placeholder.error-state .primary-button {
    background: #2196F3;
    color: white;
}

.tree-placeholder.error-state .retry-button:hover,
.tree-placeholder.error-state .primary-button:hover {
    background: #1976D2;
}

.tree-placeholder.error-state .secondary-button {
    background: #757575;
    color: white;
}

.tree-placeholder.error-state .secondary-button:hover {
    background: #616161;
}

.tree-placeholder.error-state .emergency-button {
    background: #f44336;
    color: white;
    font-size: 1.1em;
    padding: 12px 20px;
}

.tree-placeholder.error-state .emergency-button:hover {
    background: #d32f2f;
}