/* Code Viewer & Syntax Highlighting Styles */

/* Code Section Divider */
.code-section {
    margin: 15px 0;
}

/* Code Toggle Button */
.code-toggle {
    width: 100%;
    background: linear-gradient(145deg, #4a4a4a, #2a2a2a);
    color: #a3a3ff;
    border: 2px solid #7c70da;
    padding: 12px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
}

.code-toggle:hover {
    background: linear-gradient(145deg, #5a5a5a, #3a3a3a);
    border-color: #a3a3ff;
}

.code-toggle .arrow {
    transition: all 0.3s;
    font-size: 12px;
}

.code-toggle .hint-text {
    margin-left: auto;
    font-size: 8px;
    color: #7c70da;
    opacity: 0.8;
}

/* Code Content Container */
.code-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: #0a0a20;
    border: 2px solid #7c70da;
    border-top: none;
    position: relative;
}

.code-content.open {
    max-height: 620px;
    overflow-y: auto;
}

.code-content.openBig {
    max-height: 1000px;
    overflow-y: auto;
}

/* Copy Buttons */
.copy-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

.code-content.open .copy-buttons,
.code-content.openBig .copy-buttons {
    opacity: 1;
}

.copy-btn {
    background: rgba(124, 112, 218, 0.9);
    color: #fff;
    border: 2px solid #a29bff;
    border-radius: 4px;
    padding: 6px 12px;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(162, 155, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.copy-btn.copied {
    background: rgba(68, 255, 68, 0.9);
    border-color: #44ff44;
}

/* Auto Scroll Wrapper & Container */
.auto-scroll-wrapper {
    position: relative;
    margin: 10px 0;
}

.auto-scroll-container {
    height: 300px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 2px solid #7c70da;
    border-radius: 4px;
    scroll-behavior: smooth;
}

.auto-scroll-container img {
    height: 100%;
    width: auto;
    max-width: none;
    display: block;
}


/* Play/Pause Controls */
.scroll-controls {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    gap: 10px;
    opacity: 0.9;
    pointer-events: none;
}

.scroll-controls button {
    pointer-events: auto;
}

.scroll-control-btn {
    background: rgba(124, 112, 218, 0.9);
    border: 2px solid #7c70da;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.scroll-control-btn:hover {
    background: rgba(124, 112, 218, 1);
    transform: scale(1.1);
}

.scroll-control-btn:active {
    transform: scale(0.95);
}

/* Code Pre Formatting */
.code-content pre {
    margin: 0;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 17px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-content pre br {
    display: none;
}

/* BASIC Syntax Highlighting */
.basic-code .line-num {
    color: #ffa500;
    font-weight: bold;
    user-select: none;
}

.basic-code .keyword {
    color: #6bb8ff;
    font-weight: bold;
}

.basic-code .comment {
    color: #68d391;
    font-style: italic;
}

.basic-code .string {
    color: #ddf65e;
}

.basic-code .number {
    color: #9ced63;
}

.basic-code .operator {
    color: #81fcd7;
}

.basic-code .variable {
    color: #d694f4;
}

.basic-code .function {
    color: #4fd1c5;
}

/* Line Descriptions */
.line-descriptions {
    padding: 15px;
}

.line-desc {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(124, 112, 218, 0.3);
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: #a3a3ff;
}

.line-desc:last-child {
    border-bottom: none;
}

.line-num-desc {
    color: #ffa500;
    font-weight: bold;
    min-width: 30px;
    text-align: right;
}

/* Code Scrollbar Styling */
.code-content::-webkit-scrollbar {
    width: 10px;
}

.code-content::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.code-content::-webkit-scrollbar-thumb {
    background: #7c70da;
    border-radius: 5px;
}

.code-content::-webkit-scrollbar-thumb:hover {
    background: #a3a3ff;
}

/* Download List Styling */
.download-list {
    list-style: none;
    padding: 15px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(124, 112, 218, 0.1);
    border: 2px solid rgba(124, 112, 218, 0.3);
    border-radius: 5px;
    transition: all 0.2s;
}

.download-item:hover {
    background: rgba(124, 112, 218, 0.2);
    border-color: #7c70da;
    transform: translateX(5px);
}

.download-icon {
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.download-link {
    color: #a3a3ff;
    text-decoration: none;
    font-size: 11px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.download-link:hover {
    color: #7c70da;
}

/* Screenshots & Videos Grid */
.game-screenshots,
.game-videos {
    margin-bottom: 30px;
}

.screenshots-grid,
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    padding: 15px;
}

.screenshot-item,
.video-item {
    position: relative;
    border: 2px solid #7c70da;
    border-radius: 5px;
    overflow: hidden;
    background: #0a0a20;
}

.screenshot-item img,
.video-item video {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .code-toggle {
        font-size: 8px;
        padding: 10px 12px;
    }
    
    .code-content pre {
        font-size: 13px;
        padding: 10px;
    }
    
    .download-list {
        padding: 10px;
    }
    
    .download-item {
        padding: 8px;
        gap: 10px;
    }
    
    .download-icon {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }
    
    .download-link {
        font-size: 9px;
    }
    
    .download-description {
        font-size: 8px;
    }
    
    .copy-btn {
        font-size: 7px;
        padding: 6px 10px;
    }
    
    .scroll-control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .screenshots-grid,
    .videos-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }
}
