:root {
    /* Color Palette - Modern Dark (VS Code / GitHub hybrid feel) */
    --bg-app: #0d1117;
    --bg-panel: #161b22;
    --bg-hover: #21262d;
    --bg-active: #30363d;
    
    --border-subtle: #30363d;
    --border-focus: #58a6ff;
    
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-accent: #58a6ff;
    
    --accent-primary: #238636;
    --accent-hover: #2ea043;
    
    /* Glitch/Login specifics preserved or adapted */
    --glitch-color: white;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Layout --- */
.layout-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-app);
    position: relative;
}

/* --- Components --- */

/* File Tree Items */
.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 2px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-size: 14px;
}

.file-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.file-item.active {
    background-color: var(--bg-active);
    color: var(--text-primary);
}

.file-icon {
    margin-right: 8px;
    opacity: 0.7;
}

/* Viewer */
.viewer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.viewer-header {
    height: 50px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
}

.viewer-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.viewer-actions a {
    font-size: 12px;
    color: var(--text-accent);
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    transition: all 0.2s;
}

.viewer-actions a:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-accent);
}

.viewer-frame {
    flex-grow: 1;
    background: white; /* Content is usually light, keep it neutral or make it configurable */
    border: none;
    width: 100%;
    height: 100%;
}

/* Empty State */
.empty-state {
    margin: auto;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.2;
}

/* --- Login Specifics --- */
.login-container {
    margin: auto;
    text-align: center;
    padding: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    min-width: 320px;
}

input[type="text"],
input[type="password"] {
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px;
    margin: 10px 0;
    display: block;
    width: 100%;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--border-focus);
}

button {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 12px;
    margin-top: 10px;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.2s;
}

button:hover {
    background: var(--accent-hover);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--bg-active);
    border-radius: 5px;
    border: 2px solid var(--bg-app);
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* --- Landing Page --- */
.landing-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.landing-pane {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-color 0.3s;
}

.landing-left {
    background: var(--bg-app);
}

.landing-right {
    background: var(--bg-panel);
}

.landing-pane:hover {
    background: var(--bg-hover);
}

.landing-divider {
    width: 1px;
    background: var(--border-subtle);
}

.landing-link {
    text-decoration: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.landing-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.landing-pane:hover .landing-label {
    color: var(--text-accent);
}

.landing-pane .glitch {
    font-size: 48px;
}

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

    .landing-divider {
        width: 100%;
        height: 1px;
    }

    .landing-pane .glitch {
        font-size: 36px;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: 250px;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .main-content {
        height: calc(100vh - 250px);
    }
}