:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --menu-bg: #f5f5f5;
    --menu-hover: #e0e0e0;
    --menu-active: #d0d0d0;
    --border-color: #cccccc;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;

    color: var(--text-color);
    background-color: var(--bg-color);
}
article {
    display: flex;
    min-height: calc(100vh - 54px);
}
.sidebar {
    width: 280px;
    background-color: var(--menu-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px 0;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow: auto;
    max-width: 900px;
    margin: 0 auto;
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    padding: 0;
    margin: 0;
}

.menu .folder > span {
    display: block;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: bold;
}

.menu .folder > span:hover {
    background-color: var(--menu-hover);
}

.menu .folder.active > span {
    background-color: var(--menu-active);
}

.menu .file a {
    display: block;
    padding: 6px 20px 6px 35px;
    text-decoration: none;
    color: var(--text-color);
}

.menu .file a:hover {
    background-color: var(--menu-hover);
}

.menu .file.active a {
    background-color: var(--menu-active);
    font-weight: bold;
}

.submenu {
    display: none;
}

.submenu.open {
    display: block;
}

.menu .submenu ul {
    margin-left: 15px;
}

/* Markdown content styling */
.markdown-content h1 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-content img {
    max-width: 100%;
}

.markdown-content code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.markdown-content pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 16px;
    overflow: auto;
    border-radius: 3px;
}

.markdown-content blockquote {
    border-left: 4px solid var(--border-color);
    margin-left: 0;
    padding-left: 16px;
    color: #555;
}

/* Mermaid diagram styling */
.mermaid-wrapper {
    margin: 20px 0;
    text-align: center;
}

.mermaid {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
    display: inline-block;
    margin: 20px 0;
    text-align: center;
    min-width: 100%; /* Change to 100% to make it full width */
    max-width: 95%;  /* Add this to contain it slightly */
    overflow: auto;   /* Keep the content inside */
}

/* Nav styles that were previously in navbar.php */
.navbar {
    background-color: #333;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    padding: 6px 20px;
}
.navbar a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
}
.navbar a:hover {
    background-color: #575757;
}
.nav-left, .nav-right {
    display: flex;
}

/* Make the menu responsive */
@media (max-width: 768px) {
    article {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 300px;
    }
    
    .main-content {
        padding: 20px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --menu-bg: #252525;
        --menu-hover: #333333;
        --menu-active: #404040;
        --border-color: #444444;
    }
}
/* Markdown editor styles */
#markdown-editor {
    width: 100%;
    height: calc(100vh - 150px); /* Adjust height as needed */
    font-family: sans-serif;
    font-size: 16px;
    line-height: 1.5;
    padding: 10px;
    border: 1px solid #ccc;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    resize: none; /* Disable resizing */
    overflow: auto; /* Add scrollbars if content overflows */
    background-color: #f5f5f5;
    border-radius: 5px;
}

/* Side-by-side editing layout for screens wider than 768px */
@media (min-width: 769px) {
    .editor-container {
        display: flex;
        gap: 20px;
    }
    
    .editor-container .editor-pane {
        flex: 1;
        width: 50%;
    }
    
    .editor-container .preview-pane {
        flex: 1;
        width: 50%;
    }
    
    #markdown-editor {
        height: calc(100vh - 150px);
    }
    
    .preview-pane .markdown-content {
        border: 1px solid #ccc;
        border-radius: 5px;
        padding: 10px;
        height: calc(100vh - 150px);
        overflow: auto;
        background-color: var(--bg-color);
    }
}

#edit-button, #rename-button {
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
}
  
#edit-button, #rename-button { 
    background-color: #575757;
}

#edit-button.active {
    background-color: #4CAF50;
}