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

body {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
    font-size: 11px;
    height: 100vh;
    overflow: hidden;
    background: #0a0e14;
    color: #b3b9c5;
    line-height: 1.4;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* ============================================================================
   Sidebar Styles
   ============================================================================ */

.sidebar {
    width: 260px;
    background: #0d1117;
    color: #8b949e;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #21262d;
    transition: margin-left 0.15s ease;
}

.sidebar.collapsed {
    margin-left: -260px;
}

.sidebar-header {
    padding: 8px 12px;
    background: #161b22;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #21262d;
}

.sidebar-header h1 {
    font-size: 10px;
    font-weight: 700;
    color: #c9d1d9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-box {
    padding: 8px 12px;
    background: #0d1117;
    border-bottom: 1px solid #21262d;
}

.search-box input {
    width: 100%;
    padding: 4px 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 0;
    font-size: 10px;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 1px #58a6ff;
}

.search-box input::placeholder {
    color: #484f58;
}

.label-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.label-item {
    padding: 6px 12px;
    cursor: pointer;
    transition: none;
    border-left: 2px solid transparent;
    border-bottom: 1px solid #161b22;
}

.label-item:hover {
    background: #161b22;
    border-left-color: #484f58;
}

.label-item.active {
    background: #1c2128;
    border-left-color: #58a6ff;
}

.label-name {
    display: block;
    font-size: 11px;
    color: #c9d1d9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.loading-message,
.empty-message {
    padding: 24px 12px;
    text-align: center;
    color: #484f58;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   Editor Container Styles
   ============================================================================ */

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0a0e14;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #484f58;
    text-align: center;
    padding: 48px;
}

.empty-state h2 {
    font-size: 11px;
    margin-bottom: 8px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.empty-state p {
    color: #484f58;
    font-size: 10px;
}

.editor-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-view.hidden,
.empty-state.hidden {
    display: none;
}

.editor-toolbar {
    padding: 6px 12px;
    background: #161b22;
    display: flex;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid #21262d;
}

.label-name-input {
    flex: 1;
    padding: 4px 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 0;
    font-size: 10px;
    font-family: inherit;
}

.toolbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ============================================================================
   Button Styles
   ============================================================================ */

.btn {
    padding: 4px 10px;
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 0;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: none;
    font-family: inherit;
}

.btn:hover:not(:disabled) {
    background: #30363d;
    border-color: #484f58;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-primary {
    background: #0d1117;
    color: #58a6ff;
    padding: 4px 10px;
    border: 1px solid #1f6feb;
    border-radius: 0;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: none;
    font-family: inherit;
}

.btn-primary:hover {
    background: #1f6feb;
    color: #ffffff;
}

.save-status {
    color: #3fb950;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-toggle {
    padding: 4px 8px;
    background: #21262d;
    color: #58a6ff;
    border: 1px solid #30363d;
    border-radius: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    transition: none;
    line-height: 1;
}

.sidebar-toggle:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.sidebar.collapsed ~ .editor-container .sidebar-toggle::before {
    content: ']';
}

.sidebar-toggle::before {
    content: '[';
}

.empty-state .sidebar-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
}

/* ============================================================================
   Editor Styles
   ============================================================================ */

#editor-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.CodeMirror {
    height: 100% !important;
    font-size: 12px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
    line-height: 1.5;
}

.binary-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: #0a0e14;
}

.binary-view.hidden {
    display: none;
}

.binary-content {
    text-align: center;
    max-width: 400px;
}

.binary-content h3 {
    font-size: 11px;
    margin-bottom: 12px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.binary-content p {
    color: #484f58;
    margin-bottom: 16px;
    line-height: 1.5;
    font-size: 10px;
}

.binary-info {
    background: #161b22;
    padding: 12px;
    border-radius: 0;
    border: 1px solid #21262d;
    font-family: inherit;
    font-size: 10px;
    color: #58a6ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   Scrollbar Styles
   ============================================================================ */

.label-list::-webkit-scrollbar,
.CodeMirror-scroll::-webkit-scrollbar {
    width: 8px;
}

.label-list::-webkit-scrollbar-track,
.CodeMirror-scroll::-webkit-scrollbar-track {
    background: #0d1117;
}

.label-list::-webkit-scrollbar-thumb,
.CodeMirror-scroll::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 0;
}

.label-list::-webkit-scrollbar-thumb:hover,
.CodeMirror-scroll::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    /* Make sidebar overlay instead of side-by-side */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        margin-left: 0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.5);
    }

    .sidebar.collapsed {
        margin-left: -280px;
    }

    /* Editor takes full width on mobile */
    .app-container {
        flex-direction: column;
    }

    .editor-container {
        width: 100%;
        flex: 1;
        position: relative;
    }

    /* Larger touch targets */
    .btn, .btn-primary {
        font-size: 11px;
        padding: 8px 14px;
        min-height: 44px;
    }

    .sidebar-toggle {
        font-size: 14px;
        padding: 8px 12px;
        min-height: 44px;
        min-width: 44px;
    }

    .label-item {
        padding: 12px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .search-box input {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 44px;
    }

    .label-name-input {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 44px;
    }

    .sidebar-header {
        padding: 12px;
        min-height: 56px;
    }

    .sidebar-header h1 {
        font-size: 11px;
    }

    /* Adjust editor toolbar spacing */
    .editor-toolbar {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .toolbar-actions {
        gap: 12px;
    }

    /* Make CodeMirror more touch-friendly */
    .CodeMirror {
        font-size: 13px;
        line-height: 1.6;
    }
}
