/* ULTRATHINK - True ANSI Terminal Experience with IBM Plex Mono */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: auto;
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
    background: #f5f5f4; /* offwhite background */
    color: #1e1e1e; /* charcoal black text */
    line-height: 1.6;
    overflow-x: hidden;
}

ultrathink-body {
    background: #f5f5f4;
    color: #1e1e1e;
}

/* Container */
.ultrathink-container {
    min-height: 100vh;
    background: #f5f5f4;
    color: #1e1e1e;
    font-family: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
}

/* Header */
.ultrathink-header {
    background: #f5f5f4;
    border-bottom: 1px solid #ccc;
    padding: 15px 20px;
    color: #1e1e1e;
}

.breadcrumb {
    text-align: left;
    font-size: 12px;
    color: #666;
}

.breadcrumb a, .breadcrumb a:visited, .breadcrumb a:link, .breadcrumb a:active {
    color: #d73a49; /* red accent */
    text-decoration: underline;
}

.breadcrumb a:hover {
    color: #c03041;
}

/* Layout container */
.layout-container {
    display: flex;
    min-height: calc(100vh - 80px); /* Account for header height */
    margin-top: 20px;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: #f5f5f4;
    border-right: 1px solid #ccc;
    padding: 20px;
    color: #1e1e1e;
    flex-shrink: 0; /* Don't shrink */
}

.file-browser-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    color: #1e1e1e;
    font-size: 12px;
}

.folder-structure {
    font-size: 13px;
}

.folder {
    margin: 5px 0;
}

.folder-header {
    cursor: pointer;
    padding: 5px;
    margin: 2px 0;
    color: #1e1e1e; /* dark text */
    display: flex;
    align-items: center;
}

.folder-header:hover {
    background: #eaeaea;
}

.folder-header::before {
    content: "[+]";
    margin-right: 5px;
    color: #d73a49; /* red accent */
}

.folder-header.open::before {
    content: "[-]";
    color: #d73a49; /* red accent */
}

.folder-content {
    margin-left: 15px;
    display: none;
}

.folder-content.open {
    display: block;
}

.file-list .file {
    padding: 4px 5px 4px 20px;
    margin: 2px 0;
    cursor: pointer;
    color: #444; /* slightly lighter text */
    display: flex;
    align-items: center;
}

.file.active {
    background: #eaeaea;
    color: #1e1e1e;
    border-left: 2px solid #d73a49; /* red accent */
}

.file:hover {
    background: #eaeaea;
    color: #1e1e1e;
}

.file::before {
    content: ">";
    margin-right: 6px;
    color: #d73a49; /* red accent */
}

/* Main content */
.ultrathink-main {
    flex: 1;
    padding: 20px;
    background: #f5f5f4;
    color: #1e1e1e;
    overflow-y: auto; /* Allow scrolling for long content */
    max-height: calc(100vh - 80px); /* Constrain to viewport height */
}

.loading-thoughts {
    text-align: center;
    padding: 60px 0;
    color: #666;
}

.loading-thoughts pre {
    color: #666;
    font-size: 12px;
}

/* File header (for the open file path) */
.file-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    color: #1e1e1e;
    font-size: 12px;
}

.thought-body {
    color: #1e1e1e;
    line-height: 1.6;
}

.thought-body h1,
.thought-body h2,
.thought-body h3,
.thought-body h4,
.thought-body h5,
.thought-body h6 {
    color: #1e1e1e;
    margin: 1.5em 0 0.5em 0;
    line-height: 1.3;
}

.thought-body h1 { font-size: 1.6em; color: #d73a49; } /* red accent */
.thought-body h2 { font-size: 1.5em; color: #d73a49; } /* red accent */
.thought-body h3 { font-size: 1.4em; color: #d73a49; } /* red accent */
.thought-body h4 { font-size: 1.3em; color: #d73a49; } /* red accent */
.thought-body h5 { font-size: 1.2em; color: #d73a49; } /* red accent */
.thought-body h6 { font-size: 1.1em; color: #d73a49; } /* red accent */

.thought-body p {
    margin-bottom: 1em;
    color: #1e1e1e;
}

.thought-body a {
    color: #d73a49; /* red accent */
    text-decoration: underline;
}

.thought-body a:hover {
    color: #c03041;
}

.thought-body ul,
.thought-body ol {
    margin: 1em 0;
    padding-left: 2em;
}

.thought-body li {
    margin-bottom: 0.5em;
    color: #1e1e1e;
}

.thought-body blockquote {
    border-left: 2px solid #d73a49; /* red accent */
    padding-left: 1em;
    margin: 1.5em 0;
    color: #666;
    font-style: italic;
}

.thought-body code {
    background: #eaeaea;
    padding: 2px 4px;
    border-radius: 2px;
    color: #d73a49; /* red accent */
    font-family: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
    font-size: 0.9em;
}

.thought-body pre {
    background: #eaeaea;
    color: #1e1e1e;
    padding: 15px;
    border-radius: 2px;
    overflow-x: auto;
    margin: 1.5em 0;
    font-family: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid #ccc;
}

.thought-body pre code {
    background: none;
    padding: 0;
    color: #1e1e1e;
    font-size: inherit;
}

.thought-body img {
    max-width: 100%;
    height: auto;
    margin: 1.5em 0;
    border: 1px solid #ccc;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    background: #e0e0df;
    color: #1e1e1e;
    border: 1px solid #ccc;
    padding: 8px 15px;
    font-family: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
    font-size: 14px;
    cursor: pointer;
    z-index: 1000;
}

.mobile-menu-btn:hover {
    background: #d0d0ce;
}

/* Mobile sidebar overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 244, 0.95); /* offwhite with opacity */
    z-index: 2000;
    overflow-y: auto;
}

.mobile-sidebar-content {
    width: 80%;
    max-width: 300px;
    background: #f5f5f4;
    color: #1e1e1e;
    border-right: 1px solid #ccc;
    height: 100%;
    padding: 20px;
    font-family: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
}

.mobile-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.mobile-close-btn {
    background: #e0e0df;
    color: #1e1e1e;
    border: 1px solid #ccc;
    padding: 6px 12px;
    font-family: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
    font-size: 14px;
    cursor: pointer;
}

.mobile-close-btn:hover {
    background: #d0d0ce;
}

.mobile .folder-structure {
    font-size: 16px; /* Larger for mobile */
}

.mobile .file {
    padding: 8px 5px 8px 25px;
    font-size: 16px;
}

.mobile .folder-header {
    padding: 8px;
    font-size: 16px;
}

/* Navigation controls */
.nav-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.nav-btn {
    background: #e0e0df;
    color: #1e1e1e;
    border: 1px solid #ccc;
    padding: 8px 15px;
    font-family: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
    font-size: 14px;
    cursor: pointer;
}

.nav-btn:hover {
    background: #d0d0ce;
}

.nav-btn:disabled {
    background: #eaeaea;
    color: #999;
    cursor: not-allowed;
}

/* Text selection highlight */
::selection {
    background-color: #d73a49; /* red accent */
    color: white;
}

::-moz-selection {
    background-color: #d73a49; /* red accent */
    color: white;
}

/* No thoughts message */
.no-thoughts {
    text-align: center;
    padding: 40px;
    color: #888;
    font-style: italic;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .ultrathink-main {
        max-height: none; /* Remove height constraint on mobile */
    }
    
    .file-browser-header {
        font-size: 14px;
    }
    
    .folder-structure {
        font-size: 16px;
    }
    
    .file {
        padding: 8px 5px 8px 25px;
        font-size: 16px;
    }
    
    .folder-header {
        padding: 8px;
        font-size: 16px;
    }
    
    .file-header {
        font-size: 14px;
    }
    
    .thought-body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .thought-body h1 { font-size: 1.8em; }
    .thought-body h2 { font-size: 1.6em; }
    .thought-body h3 { font-size: 1.4em; }
}