:root {
    --vscode-bg: #0a0a0a;
    --vscode-sidebar: #121212;
    --vscode-panel: #1a1a1a;
    --vscode-tab-inactive: #1a1a1a;
    --vscode-tab-active: #0a0a0a;
    --vscode-border: #2a2a2a;
    --vscode-text: #e0e0e0;
    --vscode-text-muted: #808080;
    --vscode-accent: #569cd6;
    --vscode-string: #ce9178;
    --vscode-keyword: #569cd6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--vscode-bg);
    color: var(--vscode-text);
    font-family: 'Segoe UI', Menlo, Monaco, 'Courier New', monospace;
    line-height: 1.6;
    height: 100dvh;
    overflow: hidden;
}

a {
    color: var(--vscode-accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    color: #9cdcfe;
    opacity: 0.8;
}

/* Main Container */
.vscode-container {
    display: flex;
    height: 100dvh;
    width: 100vw;
    background: var(--vscode-bg);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--vscode-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--vscode-border);
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--vscode-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--vscode-text);
}

.sidebar-logo svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* File Explorer */
.file-explorer {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.explorer-section {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--vscode-text-muted);
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

.arrow {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 8px;
}

.file-tree {
    list-style: none;
}

.file-tree li {
    display: flex;
}

.file-item {
    flex: 1;
    padding: 6px 16px;
    padding-left: 28px;
    font-size: 13px;
    color: var(--vscode-text-muted);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid transparent;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--vscode-text);
    border-left-color: var(--vscode-accent);
}

.file-item:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.98);
}

.file-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--vscode-text);
    font-weight: 500;
    border-left-color: var(--vscode-accent);
}

/* Editor Container */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--vscode-bg);
    overflow: hidden;
}

/* Tab Bar */
.tab-bar {
    height: 35px;
    background: var(--vscode-panel);
    border-bottom: 1px solid var(--vscode-border);
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
}

.tabs {
    display: flex;
    gap: 0;
    flex: 1;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 100%;
    background: var(--vscode-tab-inactive);
    border-right: 1px solid var(--vscode-border);
    border-bottom: 2px solid transparent;
    color: var(--vscode-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    min-width: 120px;
    max-width: 300px;
    user-select: none;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--vscode-text);
}

.tab:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.98);
}

.tab.active {
    background: var(--vscode-tab-active);
    color: var(--vscode-text);
    border-bottom-color: var(--vscode-accent);
}

.tab-close {
    background: none;
    border: none;
    color: var(--vscode-text-muted);
    cursor: pointer;
    padding: 0 4px;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    margin-left: auto;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tab-close:hover {
    color: var(--vscode-text);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.tab-close:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

.tab span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Editor Content */
.editor-content {
    flex: 1;
    background: var(--vscode-bg);
    overflow: auto;
    position: relative;
}

.file-content {
    padding: 32px 48px;
    max-width: 1000px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--vscode-text);
}

.file-content h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 24px 0 16px;
    color: var(--vscode-text);
    border-bottom: 1px solid var(--vscode-border);
    padding-bottom: 8px;
}

.file-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 20px 0 12px;
    color: var(--vscode-text);
}

.file-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 8px;
    color: var(--vscode-text);
}

.file-content p {
    margin: 12px 0;
    color: var(--vscode-text);
}

.file-content strong {
    font-weight: 600;
    color: var(--vscode-keyword);
}

.file-content em {
    font-style: italic;
    color: var(--vscode-string);
}

.file-content ul {
    list-style: none;
    margin: 12px 0;
    padding-left: 24px;
}

.file-content li {
    margin: 6px 0;
    position: relative;
}

.file-content li:before {
    content: "•";
    position: absolute;
    left: -16px;
    color: var(--vscode-accent);
}

.file-content code {
    background: var(--vscode-panel);
    color: var(--vscode-string);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.file-content pre {
    background: var(--vscode-panel);
    border: 1px solid var(--vscode-border);
    border-radius: 4px;
    padding: 12px 16px;
    margin: 12px 0;
    overflow-x: auto;
}

.file-content pre code {
    background: none;
    padding: 0;
    color: var(--vscode-text);
}

.file-content blockquote {
    border-left: 3px solid var(--vscode-accent);
    padding-left: 16px;
    margin: 12px 0;
    font-style: italic;
    color: var(--vscode-text-muted);
}

.file-content a {
    color: var(--vscode-accent);
    text-decoration: underline;
}

.file-content a:hover {
    color: #9cdcfe;
}

/* Status Bar */
.status-bar {
    height: 24px;
    background: #007acc;
    border-top: 1px solid var(--vscode-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    color: white;
}

.status-left,
.status-right {
    display: flex;
    gap: 16px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--vscode-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--vscode-panel);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--vscode-border);
}

/* Hide scrollbars on mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
}

@media (max-width: 768px) {
    .vscode-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 40px;
        max-height: 40px;
        border-right: none;
        border-bottom: 1px solid var(--vscode-border);
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-header {
        min-width: 100px;
        padding: 0 8px;
        border-bottom: none;
        border-right: 1px solid var(--vscode-border);
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .file-explorer {
        flex: 1;
        padding: 0;
        overflow-y: hidden;
        overflow-x: auto;
        display: flex;
        -webkit-overflow-scrolling: touch;
    }

    .explorer-section {
        display: flex;
        flex-direction: row;
        margin-bottom: 0;
        min-width: max-content;
    }

    .section-title {
        display: none;
    }

    .file-tree {
        display: flex;
        flex-direction: row;
        gap: 0;
    }

    .file-tree li {
        min-width: 100px;
    }

    .file-item {
        padding: 0 8px;
        justify-content: center;
        font-size: 10px;
        border-right: 1px solid var(--vscode-border);
        border-left: none;
        white-space: nowrap;
        min-height: 40px;
    }

    .file-item.active {
        border-left: none;
        border-bottom: 2px solid var(--vscode-accent);
    }

    .file-item:hover {
        border-left: none;
    }

    .editor-container {
        width: 100%;
        height: calc(100dvh - 40px);
    }

    .tab-bar {
        height: 40px;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        min-width: 70px;
        max-width: 130px;
        font-size: 11px;
        padding: 0 8px;
        min-height: 40px;
    }

    .file-content {
        padding: 20px 16px;
        font-size: 14px;
    }

    .file-content h1 {
        font-size: 22px;
        margin: 18px 0 12px;
    }

    .file-content h2 {
        font-size: 18px;
        margin: 16px 0 10px;
    }

    .file-content h3 {
        font-size: 15px;
        margin: 14px 0 8px;
    }

    .file-content ul {
        padding-left: 20px;
    }

    .file-content li:before {
        left: -12px;
    }

    .status-bar {
        height: 30px;
        flex-direction: row;
        gap: 4px;
        padding: 4px 8px;
        font-size: 11px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .status-left,
    .status-right {
        gap: 8px;
    }

    .tab-close {
        padding: 0 2px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .sidebar-header {
        min-width: 80px;
        min-height: 40px;
        flex-shrink: 0;
    }

    .sidebar-logo {
        font-size: 8px;
        gap: 3px;
    }

    .sidebar-logo svg {
        width: 14px;
        height: 14px;
    }

    .file-item {
        padding: 0 8px;
        font-size: 10px;
        min-width: 70px;
        border-right: 1px solid var(--vscode-border);
        white-space: nowrap;
        min-height: 50px;
    }

    .file-item:nth-child(n+4) {
        display: flex;
    }

    .tab-bar {
        height: 35px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        min-width: 70px;
        max-width: 120px;
        font-size: 10px;
        padding: 0 6px;
        min-height: 35px;
    }

    .tab span {
        display: inline;
    }

    .file-content {
        padding: 16px 12px;
        font-size: 13px;
        max-width: none;
    }

    .file-content h1 {
        font-size: 18px;
        margin: 14px 0 10px;
    }

    .file-content h2 {
        font-size: 15px;
        margin: 12px 0 8px;
    }

    .file-content h3 {
        font-size: 13px;
    }

    .file-content pre {
        padding: 8px 10px;
        font-size: 11px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .file-content ul {
        padding-left: 16px;
    }

    .file-content li:before {
        left: -10px;
    }

    .status-bar {
        height: 26px;
        font-size: 10px;
        padding: 3px 6px;
        flex-wrap: wrap;
    }

    .status-left,
    .status-right {
        gap: 6px;
        min-width: 100%;
    }

    .status-right {
        display: none;
    }
}

/* Mobile Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .file-item,
    .tab,
    .tab-close {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .file-item:active {
        background: rgba(255, 255, 255, 0.15);
    }

    .tab:active {
        background: rgba(255, 255, 255, 0.15);
    }

    .file-content {
        -webkit-user-select: text;
        user-select: text;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .sidebar-header {
        min-width: 80px;
    }

    .sidebar-logo {
        font-size: 8px;
    }

    .file-item {
        padding: 0 8px;
        font-size: 10px;
        min-width: 70px;
    }

    .tab {
        min-width: 70px;
        max-width: 120px;
        padding: 0 6px;
    }

    .file-content {
        padding: 12px 10px;
        font-size: 12px;
    }

    .file-content h1 {
        font-size: 16px;
    }

    .file-content h2 {
        font-size: 14px;
    }
}
