/* =================================================================
   FILE STYLE.CSS: TRANG TRÍ GIAO DIỆN (THEME & UI)
   ================================================================= */

:root {
    /* --- MÀU GỐC "CŨ MÀ ĐẸP" (#1e1e1e) --- */
    --bg-main: #1e1e1e;       /* Nền chính */
    --bg-panel: #252526;      /* Nền tiêu đề/Panel */
    --border-color: #333333;  /* Viền tối */
    --text-main: #cccccc;
    --accent: #008c8c;        /* Màu xanh ngọc */
    
    /* --- NÚT BẤM --- */
    --btn-bg: #2d2d2d;
    --btn-border: #454545;
    --btn-hover: #3a3a3a;
}

/* 1. CẤU HÌNH CHUNG */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
}

/* 2. ĐỒNG BỘ MÀU NỀN (Làm phẳng giao diện) */
.workbench, .editor, .editor-area, 
.terminal-panel, .terminal-body, 
.sidebar, .file-explorer {
    background-color: var(--bg-main) !important;
    color: var(--text-main);
    border-color: var(--border-color);
}

/* 3. CÁC THANH TIÊU ĐỀ (HEADER) */
.file-explorer-header, .term-toolbar, .file-tabbar {
    height: 35px;
    background-color: var(--bg-panel) !important;
    border-bottom: 1px solid var(--border-color) !important;
    display: flex; align-items: center; padding: 0 10px;
    font-weight: bold; color: #bbb;
}

/* 4. TABBAR (TAB FILE) - Giống hệt file gốc */
.file-tab {
    height: 28px; padding: 0 10px; margin-right: 2px;
    background-color: #2d2d2d; /* Màu xám của tab chưa active */
    color: #969696;
    border: 1px solid transparent; 
    border-radius: 3px 3px 0 0;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.file-tab:hover { background-color: #3a3a3a; color: #fff; }
.file-tab.active {
    background-color: var(--bg-main); /* Tab active trùng màu nền editor */
    color: #fff;
    border-top: 2px solid var(--accent); /* Viền trên màu xanh */
}

/* 5. SIDEBAR ITEM (CÂY THƯ MỤC) */
.tree-item {
    padding: 4px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px;
    color: var(--text-main); white-space: nowrap; overflow: hidden;
}
.tree-item:hover { background-color: #2a2d2e; color: #fff; }
.tree-item.active {
    background-color: #37373d;
    color: #fff;
    border-left: 2px solid var(--accent);
}

/* 6. NÚT BẤM (BUTTONS) - Style gốc */
.btn-dark-pill, .icon-btn {
    height: 30px; padding: 0 12px;
    background: var(--btn-bg); color: #fff;
    border: 1px solid var(--btn-border); border-radius: 4px;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.btn-dark-pill:hover, .icon-btn:hover { background: var(--btn-hover); }

.btn-accent-pill, .btn-run-accent {
    height: 30px; padding: 0 14px;
    background: var(--accent); color: #fff;
    border: 1px solid var(--accent); border-radius: 4px;
    font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-accent-pill:hover { background: #007a7a; }

/* 7. ACE EDITOR OVERRIDE (BẮT BUỘC ĐỂ GIỐNG CŨ) */
/* Đoạn này ép Editor không bị lệch màu rêu */
.ace_editor, .ace-monokai, .ace-monokai .ace_gutter, .ace-monokai .ace_scroller, .ace-monokai .ace_content {
    background-color: var(--bg-main) !important; /* #1e1e1e */
    color: #d4d4d4 !important;
}
.ace-monokai .ace_marker-layer .ace_active-line { background-color: #282828 !important; }
.ace-monokai .ace_gutter-active-line { background-color: transparent !important; }
.ace-monokai .ace_cursor { color: #aeafad !important; border-left: 2px solid #aeafad !important; }

/* 8. TIỆN ÍCH KHÁC */
.gutter { background: var(--bg-main); border-left: 1px solid var(--border-color); }
.hidden { display: none !important; }

/* Menu chuột phải & Popup */
.context-menu, .save-popover, .modal-content {
    background: #252526; border: 1px solid #454545; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.5); z-index: 9999; border-radius: 4px;
}
.context-menu li { padding: 6px 15px; cursor: pointer; display: flex; gap: 8px; color: #ccc; }
.context-menu li:hover { background-color: #04395e; color: #fff; }
/* --- NÚT BẤM STYLE CŨ (BO TRÒN, VIỀN MỎNG) --- */

.btn-dark-pill, .icon-btn {
    height: 36px; padding: 0 12px;
    background: var(--btn-dark-bg);
    color: #e5e7eb;
    border: 1px solid var(--btn-dark-border);
    border-radius: 10px; /* Bo tròn như cũ */
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.btn-dark-pill:hover, .icon-btn:hover { background: var(--btn-dark-hover); }

.btn-accent-pill, .btn-run-accent {
    height: 36px; padding: 0 16px;
    background: var(--accent-color); color: #fff;
    border: 1px solid var(--accent-color);
    border-radius: 10px; /* Bo tròn như cũ */
    font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.btn-accent-pill:hover, .btn-run-accent:hover { background: #007a7a; }

/* Menu chuột phải & Popup */
/* CONTEXT MENU (MENU CHUỘT PHẢI) */
.context-menu {
    position: fixed; /* Dùng fixed để không bị che */
    background: #252526;
    border: 1px solid #454545;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border-radius: 6px;
    padding: 4px 0;
    list-style: none;
    min-width: 180px;
    z-index: 99999; /* Luôn nổi lên trên cùng */
}

.context-menu li {
    padding: 8px 15px;
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: space-between; /* Đẩy phím tắt sang phải */
    color: #cccccc;
    font-size: 13px;
}

.context-menu li:hover {
    background-color: #04395e; /* Màu xanh khi hover */
    color: white;
}

.context-menu .separator {
    height: 1px;
    background: #454545;
    margin: 4px 0;
    padding: 0;
}

.context-menu.hidden {
    display: none !important;
}