/**
 * Code Editor Style - Python Theme
 * Professional IDE appearance
 */

/* Code Editor Wrapper - Dynamic sizing based on content */
.code-editor-wrapper {
    background: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 24px;
    border: 1px solid rgba(167, 139, 250, 0.28);
    box-shadow:
        0 28px 72px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 56px rgba(124, 58, 237, 0.15);
    overflow: hidden;
    max-width: 950px;
    margin: 0 auto;
    animation: editorFadeIn 1s ease-out;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

@keyframes editorFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Editor Header */
.code-editor-header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7)) !important;
    backdrop-filter: blur(8px);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(167, 139, 250, 0.3);
}

.editor-buttons {
    display: flex;
    gap: 8px;
}

.editor-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.editor-btn.close {
    background: #ff5f57;
}

.editor-btn.minimize {
    background: #ffbd2e;
}

.editor-btn.maximize {
    background: #28ca42;
}

.editor-title {
    flex: 1;
    text-align: center;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
}

.editor-title i {
    color: #3776ab;
    margin-right: 8px;
}

.editor-actions {
    color: var(--accent-color);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.editor-actions:hover {
    color: #fff;
    transform: scale(1.1);
}

/* Editor Body - Adapts to content */
.code-editor-body {
    display: flex;
    background: rgba(15, 23, 42, 0.4) !important;
    backdrop-filter: blur(3px);
    padding: 25px 0;
    height: auto;
    overflow: hidden;
}

/* Line Numbers - Hidden */
.line-numbers {
    display: none;
}

/* Code Content - Limited to editor bounds */
.code-content {
    flex: 1;
    padding: 0 30px 25px 30px;
    margin: 0;
    color: #ffffff;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 18px;
    font-weight: 700;
    line-height: 2;
    overflow: hidden;
    white-space: pre;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.code-content code {
    display: block;
    white-space: pre;
    overflow: hidden;
}

/* Python Syntax Highlighting */
.code-comment {
    color: #64748b;
    font-style: italic;
    font-weight: 700;
}

.code-keyword {
    color: #c792ea;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(199, 146, 234, 0.5);
}

.code-class {
    color: #ffcb6b;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 203, 107, 0.5);
}

.code-function {
    color: #82aaff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(130, 170, 255, 0.5);
}

.code-param {
    color: #f07178;
    font-weight: 700;
}

.code-property {
    color: #89ddff;
    font-weight: 700;
}

.code-string {
    color: #c3e88d;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(195, 232, 141, 0.3);
}

.code-builtin {
    color: #f78c6c;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(247, 140, 108, 0.5);
}

.code-number {
    color: #f78c6c;
    font-weight: 700;
}

/* Editor Footer */
.code-editor-footer {
    background: rgba(10, 14, 26, 0.7) !important;
    backdrop-filter: blur(8px);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(167, 139, 250, 0.3);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #64748b;
}

.status-indicator {
    color: var(--accent-color);
}

.status-indicator i {
    font-size: 8px;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0.3; }
}

.status-info {
    padding: 4px 10px;
    background: rgba(167, 139, 250, 0.1);
    border-radius: 4px;
    margin-left: 10px;
}

/* Typing Animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

/* Cursor Effect */
.code-content::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--primary-color);
    margin-left: 2px;
    animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Scrollbar for code */
.code-editor-body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.code-editor-body::-webkit-scrollbar-track {
    background: #0a0e1a;
}

.code-editor-body::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.3);
    border-radius: 5px;
}

.code-editor-body::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .code-editor-wrapper {
        max-width: 100%;
        margin: 0 15px;
    }
    
    .code-editor-body {
        overflow: hidden;
    }
    
    .code-content {
        font-size: 14px;
        font-weight: 600;
        padding: 0 10px 20px 10px;
        line-height: 1.9;
        overflow: hidden;
    }
    
    .line-numbers {
        padding: 0 10px 20px 10px;
        font-size: 14px;
        font-weight: 600;
        min-width: 45px;
        line-height: 1.9;
        overflow: hidden;
    }
    
    .editor-title {
        font-size: 12px;
    }
    
    .code-editor-footer {
        font-size: 10px;
        padding: 6px 15px;
    }
}

@media (max-width: 576px) {
    .code-editor-body {
        overflow: hidden;
    }
    
    .code-content {
        font-size: 12px;
        font-weight: 600;
        line-height: 1.8;
        padding: 0 8px 15px 8px;
        overflow: hidden;
    }
    
    .line-numbers {
        font-size: 12px;
        font-weight: 600;
        line-height: 1.8;
        padding: 0 8px 15px 8px;
        overflow: hidden;
    }
    
    .editor-buttons {
        gap: 6px;
    }
    
    .editor-btn {
        width: 10px;
        height: 10px;
    }
}
