html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

.judge0-file-menu {
    min-width: 15rem !important;
}

#judge0-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

#judge0-chat-container > .ui.menu {
    border-bottom: none;
}

#judge0-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

#judge0-chat-messages pre {
    overflow-x: auto;
    max-width: 100%;
}

.item.judge0-showRunButton{
    display:flex;
    gap:10px;
}

/* Action buttons */
.item.judge0-showRunButton {
    display: flex;
    gap: 8px;
}

.item.judge0-showRunButton .ui.button {
    font-size: 13px !important;
    padding: 0.6em 0.9em !important;
}

/* Terminal button */
.terminal-btn {
    font-family: 'JetBrains Mono', monospace !important;
    font-weight: 700 !important;
}

.terminal-btn .terminal-label {
    font-size: 14px;
}

/* Account dropdown */
#judge0-account-dropdown {
    font-size: 13px !important;
    padding: 0.6em 0.8em !important;
}

#judge0-account-dropdown .menu {
    min-width: 160px;
}

#judge0-account-dropdown .menu .item {
    font-size: 13px !important;
}

.judge0-user-message {
    margin-left: auto !important;
    margin-right: 1em !important;
    margin-top: 1em !important;
    max-width: 66%;
    overflow-wrap: break-word;
    width: fit-content;
}

#judge0-chat-input-container {
    margin-top: 0;
}

#judge0-status-line:empty {
    display: none;
}

.judge0-hidden, .judge0-style-hidden {
    display: none !important;
}

/* ===== Site Wrapper: activity bar + sidebar + editor ===== */
#judge0-site-wrapper {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ===== Activity Bar (VS Code icon strip) ===== */
#judge0-activity-bar {
    width: 48px;
    min-width: 48px;
    background: #252526;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4px;
    border-right: 1px solid #1e1e1e;
    z-index: 100;
}

.activity-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #858585;
    border-left: 2px solid transparent;
    transition: color 0.15s;
}

.activity-icon:hover {
    color: #d4d4d4;
}

.activity-icon.active {
    color: #ffffff;
    border-left-color: #ffffff;
}

/* ===== File Explorer Sidebar ===== */
#judge0-sidebar {
    width: 240px;
    min-width: 180px;
    max-width: 600px;
    background: #252526;
    border-right: 1px solid #1e1e1e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 99;
}

#sidebar-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 100;
}

#sidebar-resizer:hover, #sidebar-resizer.dragging {
    background: #007fd4;
}

#judge0-sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right: none;
    display: none !important;
}

#sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    height: 35px;
    min-height: 35px;
    user-select: none;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #bbbbbb;
    text-transform: uppercase;
}

.sidebar-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

#sidebar-header:hover .sidebar-actions {
    opacity: 1;
}

.sidebar-action-btn {
    background: none;
    border: none;
    color: #858585;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #d4d4d4;
}

/* ===== File Tree ===== */
#sidebar-tree {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}

#sidebar-tree::-webkit-scrollbar {
    width: 6px;
}

#sidebar-tree::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sidebar-placeholder {
    color: #858585;
    font-size: 12px;
    padding: 16px 20px;
    text-align: center;
}

.tree-item {
    display: flex;
    align-items: center;
    height: 22px;
    padding-right: 8px;
    cursor: pointer;
    color: #cccccc;
    font-size: 13px;
    font-family: 'Segoe UI', -apple-system, sans-serif;
    white-space: nowrap;
    user-select: none;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tree-item.selected {
    background: #094771;
}

.tree-item.selected:hover {
    background: #094771;
}

.tree-item.active-folder {
    background: rgba(255, 255, 255, 0.05);
}

.tree-item-indent {
    display: inline-block;
    width: 16px;
    min-width: 16px;
}

.tree-item-arrow {
    width: 16px;
    min-width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #858585;
    transition: transform 0.1s;
}

.tree-item-arrow.open {
    transform: rotate(90deg);
}

.tree-item-arrow.hidden {
    visibility: hidden;
}

.tree-item-icon {
    width: 16px;
    min-width: 16px;
    margin-right: 4px;
    text-align: center;
    font-size: 14px;
}

.tree-item-icon.folder {
    color: #dcb67a;
}

.tree-item-icon.file-java { color: #e76f00; }
.tree-item-icon.file-py   { color: #3572a5; }
.tree-item-icon.file-c    { color: #555599; }
.tree-item-icon.file-js   { color: #f7df1e; }
.tree-item-icon.file-txt  { color: #858585; }
.tree-item-icon.file-default { color: #858585; }

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

.tree-children {
    display: none;
}

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

/* ===== Editor area fills remaining space ===== */
#judge0-site-content {
    flex: 1;
    min-width: 0;
}

/* ===== Light theme overrides ===== */
body.light-theme #judge0-activity-bar,
body.light-theme #judge0-sidebar {
    background: #f3f3f3;
    border-right-color: #e0e0e0;
}

body.light-theme .activity-icon { color: #616161; }
body.light-theme .activity-icon:hover { color: #333333; }
body.light-theme .activity-icon.active { color: #333333; border-left-color: #333333; }

body.light-theme .sidebar-title { color: #6f6f6f; }
body.light-theme .sidebar-action-btn { color: #616161; }
body.light-theme .sidebar-action-btn:hover { background: rgba(0, 0, 0, 0.06); color: #333333; }

body.light-theme .tree-item { color: #333333; }
body.light-theme .tree-item:hover { background: rgba(0, 0, 0, 0.04); }
body.light-theme .tree-item.selected { background: #0060c0; color: #ffffff; }
body.light-theme .tree-item.active-folder { background: rgba(0, 0, 0, 0.05); }
body.light-theme .tree-item-arrow { color: #616161; }
body.light-theme .sidebar-placeholder { color: #999999; }

/* Editor toolbar */
.judge0-editorToolbar {
    display: flex !important;
    align-items: center;
    gap: 6px;
}

.judge0-editorToolbar .ui.buttons,
.judge0-editorToolbar .ui.button {
    font-size: 13px !important;
}

.judge0-editorToolbar .ui.buttons .ui.button {
    padding: 0.78em 1em !important;
}

.judge0-editorToolbar #font-size-display {
    opacity: 0.7 !important;
    font-weight: 600;
    min-width: 52px;
    text-align: center;
    cursor: default;
}

/* Subtle separator between toolbar groups */
.judge0-editorToolbar .ui.buttons + .ui.buttons {
    border-left: 1px solid rgba(128, 128, 128, 0.25);
    padding-left: 6px;
}

#word-wrap-btn.active {
    background-color: #2185d0 !important;
    color: white !important;
}

/* Error line highlighting */
.judge0-error-line {
    background-color: rgba(255, 0, 0, 0.12) !important;
    border-left: 3px solid #ff4444 !important;
}

.judge0-error-glyph {
    background-color: #ff4444;
    border-radius: 50%;
    margin-left: 5px;
    width: 8px !important;
    height: 8px !important;
    margin-top: 6px;
}

@media (display-mode: standalone) {
    .judge0-standalone-hidden {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .judge0-file-menu {
        min-width: 12rem !important;
    }

    .item.judge0-showRunButton {
        flex-direction: column;
        gap: 5px;
    }

    .judge0-user-message {
        max-width: 95%;
        margin-right: 0.5em !important;
    }

    #judge0-chat-messages {
        padding: 0.25rem;
    }
}

#file-explorer-list {
  flex: 1;
  overflow-y: auto;
  padding: 5px 0;
}

#judge0-sidebar {
  display: flex;
  flex-direction: column;
}

.file-item {
  padding: 6px 10px;
  cursor: pointer;
  color: white;
  font-size: 14px;
}

.file-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.file-actions {
  opacity: 0;                     /* hidden initially */
  transition: opacity 0.2s ease;  /* smooth fade in */
}

.file-item:hover .file-actions {
  opacity: 1;                     /* show on hover */
}

.file-actions i {
  color: #aaa;        /* default color (gray) */
}

.file-item:hover .file-actions i {
  color: #ccc;        /* slightly brighter on hover */
}

.file-actions i:hover {
  color: #fff;        /* bright white when hovering icon */
}
