/* ============================================================
   VS CODE EDITOR - بدون اسکرول، ارتفاع کم
   ============================================================ */

.code-editor,
.code-editor * {
    direction: ltr !important;
    text-align: left !important;
    box-sizing: border-box;
}

.code-editor {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    background: #1e1e1e;
    border: 1px solid #313131;
    border-radius: 8px;
    overflow: visible !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
    font-family: 'Cascadia Code', 'Consolas', 'Fira Code', monospace;
}

/* ===== Header ===== */
.editor-header {
    height: 22px !important;
    background: #252526;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-bottom: 1px solid #2d2d2d;
    border-radius: 8px 8px 0 0;
}

/* ===== دایره‌های رنگی ===== */
.editor-buttons {
    display: flex !important;
    gap: 5px;
    align-items: center;
    flex-shrink: 0;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block !important;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
}

.dot-red { 
    background: #ff5f56 !important; 
}
.dot-yellow { 
    background: #ffbd2e !important; 
}
.dot-green { 
    background: #27c93f !important; 
}

.file-name {
    color: #bbbbbb;
    font-size: 9px;
    margin: 0 auto;
    font-family: 'Segoe UI', sans-serif;
}

/* ===== Body ===== */
.editor-body {
    display: flex;
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0;
}

/* ===== Editor Content ===== */
.editor-content {
    flex: 1;
    overflow: visible !important;
    padding: 2px 8px !important;
    height: auto !important;
    background: #1e1e1e;
}

.editor-content pre {
    margin: 0;
    padding: 0;
    font-size: 10px !important;
    line-height: 1.2 !important;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== هر خط ===== */
.line {
    display: flex;
    align-items: flex-start;
    min-height: 14px !important;
    padding: 0 !important;
    border-radius: 2px;
}

.line:hover {
    background: rgba(255, 255, 255, 0.03);
}

.line-number {
    width: 26px !important;
    min-width: 26px !important;
    color: #6e7681;
    user-select: none;
    text-align: right !important;
    padding-right: 6px !important;
    font-size: 8px !important;
    flex-shrink: 0;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    opacity: 0.6;
}

.line-code {
    flex: 1;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 10px !important;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    padding-left: 3px !important;
    line-height: 1.2 !important;
}

/* ===== Active Line ===== */
.line.active-line {
    background: rgba(255, 255, 255, 0.04);
}

.line.active-line .line-number {
    color: #d4d4d4;
    opacity: 1;
}

/* ============================================================
   SYNTAX HIGHLIGHTING
   ============================================================ */

.token-php { color: #569cd6; }
.token-keyword { color: #c586c0; font-weight: 500; }
.token-string { color: #ce9178; }
.token-property { color: #9cdcfe; }
.token-function { color: #dcdcaa; }
.token-number { color: #b5cea8; }
.token-comment { color: #6a9955; font-style: italic; }
.token-variable { color: #9cdcfe; }
.token-operator { color: #d4d4d4; }
.token-bracket { color: #d4d4d4; }
.token-echo { color: #dcdcaa; }
.token-html { color: #569cd6; }

/* ===== Cursor ===== */
.cursor {
    display: inline-block;
    width: 1.5px;
    height: 9px !important;
    background: #ffffff;
    margin-left: 1px;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== Status Bar ===== */
.editor-statusbar {
    height: 14px !important;
    background: #007acc;
    display: flex;
    align-items: center;
    padding: 0 8px !important;
    gap: 6px;
    font-size: 7px !important;
    color: #ffffff;
    font-family: 'Segoe UI', sans-serif;
    border-radius: 0 0 8px 8px;
    letter-spacing: 0.2px;
}

.editor-statusbar .status-lines {
    font-weight: 500;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 750px) {
    .code-editor {
        max-width: 100%;
        border-radius: 6px;
    }
    .editor-header {
        height: 18px !important;
        border-radius: 6px 6px 0 0;
        padding: 0 6px;
    }
    
    .editor-buttons {
        gap: 4px !important;
    }
    
    .dot {
        width: 6px !important;
        height: 6px !important;
        display: inline-block !important;
        flex-shrink: 0;
    }
    
    .editor-statusbar {
        height: 12px !important;
        border-radius: 0 0 6px 6px;
        font-size: 6px !important;
        padding: 0 6px !important;
        gap: 4px;
    }
    .editor-content {
        padding: 1px 6px !important;
    }
    .editor-content pre {
        font-size: 9px !important;
        line-height: 1.2 !important;
    }
    .line-number {
        width: 20px !important;
        min-width: 20px !important;
        padding-right: 4px !important;
        font-size: 7px !important;
    }
    .line-code {
        font-size: 9px !important;
        padding-left: 3px !important;
        line-height: 1.2 !important;
    }
    .line {
        min-height: 12px !important;
    }
    .cursor {
        height: 7px !important;
    }
    .file-name {
        font-size: 8px;
    }
}

@media (max-width: 400px) {
    .editor-header {
        height: 15px !important;
        padding: 0 4px;
    }
    
    .editor-buttons {
        gap: 3px !important;
    }
    
    .dot {
        width: 5px !important;
        height: 5px !important;
        display: inline-block !important;
    }
    
    .editor-statusbar {
        height: 10px !important;
        font-size: 5px !important;
        padding: 0 4px !important;
        gap: 3px;
    }
    .editor-content {
        padding: 0 4px !important;
    }
    .editor-content pre {
        font-size: 7px !important;
        line-height: 1.1 !important;
    }
    .line-number {
        width: 16px !important;
        min-width: 16px !important;
        padding-right: 3px !important;
        font-size: 6px !important;
    }
    .line-code {
        font-size: 7px !important;
        padding-left: 2px !important;
        line-height: 1.1 !important;
    }
    .line {
        min-height: 10px !important;
    }
    .cursor {
        height: 6px !important;
    }
    .file-name {
        font-size: 7px;
    }
}

/* ============================================================
   اورراید نهایی برای اطمینان
   ============================================================ */

/* ===== دایره‌ها ===== */
.code-editor .editor-header .editor-buttons .dot {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
}

.code-editor {
    overflow: hidden !important;
}

.code-editor .editor-body {
    overflow: hidden !important;
}

.code-editor .editor-content {
    overflow: hidden !important;
}