/* ANTICHEAT VIEWER - VSCODE-LIKE PREMIUM DESIGN */

.ac-layout {
    display: flex;
    height: calc(100vh - 60px); 
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* ── SIDEBAR / EXPLORER ─────────────────────────────────── */
.ac-sidebar {
    width: 280px;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.explorer-header {
    padding: 12px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 8px;
}

.explorer-header i { font-size: 13px; color: var(--text-muted); }

.ac-selector {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-selected {
    width: 100%;
    padding: 8px 32px 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.custom-dropdown-selected:hover {
    border-color: var(--primary);
    background: rgba(229, 37, 33, 0.05);
}

.custom-dropdown.open .custom-dropdown-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(229, 37, 33, 0.1);
}

.custom-dropdown-arrow {
    font-size: 10px;
    color: #71717a;
    transition: transform 0.2s;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-options {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.custom-dropdown.open .custom-dropdown-options {
    display: block;
}

.custom-dropdown-option {
    padding: 8px 12px;
    font-size: 12px;
    color: #e4e4e7;
    cursor: pointer;
    transition: background 0.15s;
}

.custom-dropdown-option:hover {
    background: rgba(229, 37, 33, 0.1);
}

.custom-dropdown-option.selected {
    background: rgba(229, 37, 33, 0.15);
    color: #fff;
}

/* ── FILE TREE ───────────────────────────────────────────── */
.ac-tree {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.ac-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.6;
    opacity: 0.6;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 3px 0;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
    user-select: none;
    transition: background 0.15s, color 0.15s;
    border-left: 2px solid transparent;
    min-height: 26px;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.tree-item.active {
    background: rgba(229, 37, 33, 0.08);
    color: var(--text);
    border-left-color: var(--primary);
}

.tree-chevron-slot {
    width: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-dim);
    font-size: 10px;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.tree-item.open .tree-chevron-slot i {
    transform: rotate(90deg);
}

.tree-icon-slot {
    width: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 4px;
    font-size: 14px;
    flex-shrink: 0;
}

.tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tree icon colors */
.tree-icon-slot .folder { color: #e8a838; }
.tree-icon-slot .lua { color: #51a0cf; }
.tree-icon-slot .file { color: #666; }

.tree-children {
    display: none;
}
.tree-children.open {
    display: block;
}

/* ── EDITOR AREA ─────────────────────────────────────────── */
.ac-editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.15);
    min-width: 0;
}

/* ── TAB BAR ─────────────────────────────────────────────── */
.ac-tab-bar {
    height: 36px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.ac-tab-bar::-webkit-scrollbar { display: none; }

.ac-tab {
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
    height: 100%;
    color: var(--text-dim);
    font-size: 12px;
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    position: relative;
    min-width: 0;
    flex-shrink: 0;
}

.ac-tab:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

.ac-tab.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.ac-tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* Pinned tab */
.ac-tab.pinned {
    padding: 0 10px;
    min-width: 36px;
    justify-content: center;
}
.ac-tab.pinned .tab-name { display: none; }
.ac-tab.pinned .close-tab { display: none; }
.ac-tab.pinned .pin-indicator {
    display: flex;
    font-size: 8px;
    color: var(--primary);
    position: absolute;
    top: 3px;
    right: 3px;
}

/* Dragging state */
.ac-tab.dragging {
    opacity: 0.4;
}
.ac-tab.drag-over {
    border-left: 2px solid var(--primary);
}

.ac-tab i.tab-icon { font-size: 13px; flex-shrink: 0; }
.ac-tab .tab-name { overflow: hidden; text-overflow: ellipsis; }
.ac-tab .close-tab {
    font-size: 10px;
    padding: 3px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ac-tab:hover .close-tab { opacity: 0.5; }
.ac-tab .close-tab:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    color: #ff4d4d;
}
.ac-tab .pin-indicator { display: none; }

/* ── TAB CONTEXT MENU ────────────────────────────────────── */
.ac-context-menu {
    position: fixed;
    z-index: 1000;
    min-width: 180px;
    background: rgba(25, 25, 28, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
}

.ac-context-menu.active { display: block; }

.ac-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.15s;
}

.ac-context-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.ac-context-item i { width: 14px; text-align: center; font-size: 11px; }

.ac-context-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 3px 8px;
}

.ac-context-item.danger:hover {
    background: rgba(229, 37, 33, 0.1);
    color: var(--primary);
}

/* ── EDITOR CONTAINER ────────────────────────────────────── */
.ac-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.ac-file-path {
    padding: 6px 16px;
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
}

.ac-file-path .path-sep { color: var(--text-dim); opacity: 0.3; }

.ac-code-block {
    flex: 1;
    overflow: auto;
    padding: 0;
    counter-reset: line;
}

.ac-code-block .code-lines {
    margin: 0;
    font-family: 'Consolas', 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    padding: 8px 12px;
}

.ac-code-block .code-line {
    display: flex;
    min-height: 18px;
}

.ac-code-block .line-num {
    width: 36px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 12px;
    color: rgba(255, 255, 255, 0.15);
    user-select: none;
    font-size: 11px;
}

.ac-code-block .line-content {
    flex: 1;
    white-space: pre;
    min-width: 0;
}

/* Splash screen */
.ac-splash {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim);
    gap: 12px;
}

.ac-splash i {
    font-size: 64px;
    opacity: 0.06;
}

.ac-splash p {
    font-size: 13px;
    line-height: 1.6;
    opacity: 0.5;
    max-width: 320px;
}

/* Copy button */
.ac-copy-btn {
    position: absolute;
    top: 40px;
    right: 16px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    z-index: 100;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 5px;
}

.ac-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── STATUS BAR ──────────────────────────────────────────── */
.ac-status-bar {
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 11px;
    color: var(--text-dim);
    gap: 16px;
    flex-shrink: 0;
}

.ac-status-bar .status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ac-status-bar .status-item i { font-size: 10px; }

.ac-status-bar .status-spacer { flex: 1; }

/* ── SCROLLBARS ──────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .ac-sidebar { width: 100%; height: 260px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .ac-layout { flex-direction: column; }
}
