/* CSS Custom Properties for consistent theming */
:root {
    /* VS Code Color Palette */
    --vs-dark: #1e1e1e;
    --vs-sidebar: #252526;
    --vs-border: #3e3e42;
    --vs-lighter: #2d2d30;
    --vs-text: #cccccc;
    --vs-text-light: #ffffff;
    --vs-blue: #007acc;
    --vs-blue-dark: #094771;
    --vs-folder: #dcb67a;
    --vs-html: #e34c26;
    --vs-css: #1572b6;
    --vs-hover: #2a2d2e;
    --vs-header: #333;
    
    /* Animation values */
    --fade-duration: 0.4s;
    --spin-duration: 1s;
    --transition-duration: 0.5s;
}

/* Optimized base styles */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn var(--fade-duration) ease-in-out forwards;
}

/* Consolidated animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Page transition overlay */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--vs-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-duration) ease-in-out;
}

.page-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.transition-content {
    text-align: center;
    color: var(--vs-text);
}

.transition-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--vs-border);
    border-top: 3px solid var(--vs-blue);
    border-radius: 50%;
    animation: spin var(--spin-duration) linear infinite;
    margin: 0 auto 20px;
}

header {
    background: var(--vs-header);
    color: var(--vs-text-light);
    padding: 0.5rem 0;
}


/* Optimized VS Code Interface */
.vscode-interface {
    display: flex;
    flex: 1;
    background: var(--vs-dark);
    overflow: hidden;
    opacity: 0;
    animation: slideInFromLeft var(--fade-duration) ease-out 0.1s forwards;
}

/* File Explorer */
.file-explorer {
    width: 250px;
    background: var(--vs-sidebar);
    border-right: 1px solid var(--vs-border);
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: slideInFromLeft 0.3s ease-out 0.2s forwards;
}

.explorer-header {
    padding: 10px 15px;
    background: var(--vs-lighter);
    color: var(--vs-text);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid var(--vs-border);
}

.file-tree {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.folder {
    margin-bottom: 5px;
}

.folder-header {
    display: flex;
    align-items: center;
    padding: 4px 15px;
    color: var(--vs-text);
    cursor: pointer;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.folder-header:hover {
    background: var(--vs-hover);
}

.folder-icon {
    margin-right: 6px;
    font-size: 12px;
    color: var(--vs-folder);
}

.folder-content {
    margin-left: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 4px 15px;
    color: var(--vs-text);
    cursor: pointer;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.file-item:hover {
    background: var(--vs-hover);
}

.file-item.active {
    background: var(--vs-blue-dark);
    color: var(--vs-text-light);
}

.file-icon {
    margin-right: 6px;
    font-size: 12px;
}

.file-icon.html {
    color: var(--vs-html);
}

.file-icon.css {
    color: var(--vs-css);
}

.file-icon.js {
    color: #f7df1e;
}

.file-icon.project {
    color: #4fc3f7;
}

/* Code Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: slideInFromRight 0.3s ease-out 0.3s forwards;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tab-bar {
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    min-height: 35px;
    overflow-x: auto;
    overflow-y: hidden;
}

.tab {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: #2d2d30;
    color: #cccccc;
    border-right: 1px solid #3e3e42;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    min-width: 120px;
    max-width: 200px;
}

.tab.active {
    background: #1e1e1e;
    color: #ffffff;
}

.tab:hover {
    background: #2a2d2e;
}

.tab.active:hover {
    background: #1e1e1e;
}

.tab-icon {
    margin-right: 6px;
    font-size: 12px;
    flex-shrink: 0;
}

.tab span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-close {
    margin-left: 8px;
    padding: 2px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    flex-shrink: 0;
}

.tab:hover .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: #464647;
    color: #ffffff;
}

.editor-content {
    flex: 1;
    background: #1e1e1e;
    display: flex;
    overflow: hidden;
}

.line-numbers {
    background: #1e1e1e;
    color: #858585;
    padding: 20px 10px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    border-right: 1px solid #3e3e42;
    min-width: 50px;
}

.line-numbers span {
    display: block;
}

.code-area {
    flex: 1;
    padding: 20px;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-y: auto;
}

/* Project Display Styles */
.project-display {
    display: none;
}

.project-display.active {
    display: block;
}

.project-header {
    margin-bottom: 20px;
}

.project-title {
    color: #4fc3f7;
    font-size: 24px;
    margin-bottom: 10px;
}

.project-description {
    color: #cccccc;
    line-height: 1.6;
}

.project-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Slideshow Styles */
.project-slideshow {
    margin-bottom: 20px;
}

.slideshow-container {
    position: relative;
    max-width: 100%;
    margin: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slide {
    display: none;
    position: relative;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
}

.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
}

.slide-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.slide-nav.prev {
    left: 15px;
}

.slide-nav.next {
    right: 15px;
}

.slide-dots {
    text-align: center;
    padding: 15px 0;
    background: rgba(30, 30, 30, 0.9);
}

.dot {
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: #666;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover,
.dot.active {
    background-color: #007acc;
    transform: scale(1.2);
}

.project-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.detail-section {
    background: #252526;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #3e3e42;
}

.detail-title {
    color: #569cd6;
    font-weight: bold;
    margin-bottom: 10px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tech-tag {
    background: #094771;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.project-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #007acc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.project-link:hover {
    background: #005a9e;
}

.project-link i {
    margin-right: 6px;
}

/* Default content */
.default-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #858585;
    text-align: center;
}

.default-content i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #4fc3f7;
}

.home-instruction {
    margin-top: 10px;
    color: #999;
    font-style: italic;
    font-size: 14px;
}

   /* Footer */
footer {
    background: #1e1e1e;
    color: #cccccc;
    text-align: center;
    padding: 0;
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
    border: none;
    box-shadow: none;
}


/* Responsive design */
@media (max-width: 768px) {
    .vscode-interface {
        flex-direction: column;
    }
    
    .file-explorer {
        width: 100%;
        max-height: 200px;
    }
    
    .project-details {
        grid-template-columns: 1fr;
    }
}