/* Code Canvas Modal Styles */
.code-canvas-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.code-canvas-container {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.code-canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.code-canvas-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.code-canvas-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.code-canvas-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.code-canvas-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.code-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.code-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.code-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.code-canvas-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.code-tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    overflow: auto;
}

.code-tab-content.active {
    display: block;
}

#code-view {
    background: #ffffff;
    padding: 0;
    border: 1px solid #e0e0e0;
}

#code-view pre {
    margin: 0;
    padding: 20px;
    height: 100%;
    overflow: auto;
}

#code-view code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #1e1e1e;
    white-space: pre-wrap;
}

#result-view {
    background: white;
}

.code-canvas-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    justify-content: flex-end;
}

.code-canvas-footer .btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-canvas-footer .btn-outline {
    background: white;
    border: 1px solid #ddd;
    color: #333;
}

.code-canvas-footer .btn-outline:hover {
    background: #f0f0f0;
    border-color: #667eea;
    color: #667eea;
}

.code-canvas-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.code-canvas-footer .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Syntax Highlighting (Basic Light Theme) */
.language-javascript {
    color: #1e1e1e;
}

.keyword {
    color: #0033b0;
    font-weight: bold;
}

.string {
    color: #067d17;
}

.comment {
    color: #7e7e7e;
    font-style: italic;
}

.function {
    color: #7a7a43;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .code-canvas-container {
        width: 95%;
        height: 90vh;
    }

    .code-canvas-header {
        padding: 16px 20px;
    }

    .code-canvas-header h3 {
        font-size: 18px;
    }

    .code-canvas-tabs {
        padding: 8px 20px;
    }

    .code-tab {
        padding: 8px 16px;
        font-size: 13px;
    }

    #code-view code {
        font-size: 12px;
    }

    .code-canvas-footer {
        padding: 12px 20px;
        flex-wrap: wrap;
    }

    .code-canvas-footer .btn {
        flex: 1;
        min-width: 120px;
    }
}