/* ==========================================
   GUI Styles - DOS Navigator/Norton Commander Style
   ========================================== */

/* Main GUI Container */
#gui-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #004080;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    z-index: 9999;
    display: none;
    flex-direction: column;
}

#gui-container.active {
    display: flex;
}

/* Exit Button - w prawym górnym rogu */
#gui-exit-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #404080;
    border: 1px solid #8080ff;
    color: #ffff00;
    padding: 3px 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    z-index: 10001;
}

#gui-exit-btn:hover {
    background: #6060a0;
    border-color: #a0a0ff;
}

#gui-exit-btn:active {
    background: #202040;
}

/* Title Bar */
#gui-title-bar {
    width: 100%;
    background: #000080;
    color: #ffff00;
    padding: 2px 5px;
    border-bottom: 1px solid #00ffff;
    font-size: 12px;
    display: flex;
    align-items: center;
}

#gui-title-bar::before {
    content: '╔═══════════════════════════════════════════╗';
    white-space: pre;
}

/* Main Content Area */
#gui-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding: 5px;
}

/* File Explorer - Two Panel Layout */
#file-explorer {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 5px;
}

/* Left Panel - Directory Tree */
#file-explorer-left {
    flex: 1;
    background: #001020;
    border: 1px solid #008080;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#file-explorer-left-header {
    background: #003050;
    color: #ffff00;
    padding: 2px 5px;
    border-bottom: 1px solid #008080;
    font-weight: bold;
    font-size: 11px;
}

#file-explorer-left-content {
    flex: 1;
    overflow-y: auto;
    padding: 2px;
    font-size: 11px;
}

/* Right Panel - File List */
#file-explorer-right {
    flex: 1;
    background: #001020;
    border: 1px solid #008080;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#file-explorer-right-header {
    background: #003050;
    color: #ffff00;
    padding: 2px 5px;
    border-bottom: 1px solid #008080;
    font-weight: bold;
    font-size: 11px;
}

#file-explorer-right-content {
    flex: 1;
    overflow-y: auto;
    padding: 2px;
    font-size: 11px;
}

/* Directory Tree Items */
.dir-tree-item {
    padding: 1px 5px;
    cursor: pointer;
    user-select: none;
}

.dir-tree-item:hover {
    background: #003040;
    color: #ffff00;
}

.dir-tree-item.selected {
    background: #0060a0;
    color: #ffffff;
}

.dir-tree-item.nested {
    padding-left: 15px;
}

/* File List Items */
.file-item {
    padding: 2px 5px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #002020;
}

.file-item:hover {
    background: #003040;
    color: #ffff00;
}

.file-item.selected {
    background: #0060a0;
    color: #ffffff;
}

.file-item.dir-item::before {
    content: '[DIR] ';
    color: #ffff00;
}

.file-item.md-file::before {
    content: '[MD] ';
    color: #00ff00;
}

.file-item.other-file::before {
    content: '[FILE] ';
    color: #808080;
}

/* Markdown Viewer Modal */
#markdown-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
}

#markdown-viewer-modal.active {
    display: flex;
}

#markdown-viewer-content {
    background: #001020;
    border: 2px solid #00ffff;
    color: #00ffff;
    width: 90%;
    max-width: 800px;
    height: 80%;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#markdown-viewer-header {
    background: #003050;
    color: #ffff00;
    padding: 5px 10px;
    border-bottom: 1px solid #00ffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

#markdown-viewer-title {
    font-weight: bold;
}

#markdown-viewer-close {
    background: #604040;
    border: 1px solid #ff8080;
    color: #ffff00;
    padding: 2px 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

#markdown-viewer-close:hover {
    background: #806060;
}

#markdown-viewer-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    font-size: 12px;
    line-height: 1.6;
}

/* Markdown Styling */
#markdown-viewer-body h1 {
    color: #ffff00;
    border-bottom: 1px solid #00ffff;
    padding-bottom: 5px;
    margin: 15px 0 10px 0;
}

#markdown-viewer-body h2 {
    color: #ffff80;
    border-bottom: 1px solid #00ff80;
    padding-bottom: 3px;
    margin: 12px 0 8px 0;
}

#markdown-viewer-body h3 {
    color: #80ffff;
    margin: 10px 0 6px 0;
}

#markdown-viewer-body p {
    margin: 8px 0;
}

#markdown-viewer-body ul,
#markdown-viewer-body ol {
    margin: 8px 0;
    padding-left: 25px;
}

#markdown-viewer-body li {
    margin: 3px 0;
}

#markdown-viewer-body code {
    background: #002020;
    padding: 2px 4px;
    border: 1px solid #0060a0;
    color: #00ff00;
}

#markdown-viewer-body pre {
    background: #000020;
    padding: 8px;
    border: 1px solid #0080a0;
    overflow-x: auto;
    margin: 8px 0;
}

#markdown-viewer-body blockquote {
    border-left: 3px solid #008080;
    padding-left: 10px;
    margin: 8px 0;
    color: #80ffff;
}

#markdown-viewer-body a {
    color: #00ffff;
    text-decoration: underline;
}

#markdown-viewer-body strong {
    color: #ffff00;
    font-weight: bold;
}

#markdown-viewer-body em {
    color: #ff8080;
    font-style: italic;
}

/* Scrollbar Styling */
#file-explorer-left-content::-webkit-scrollbar,
#file-explorer-right-content::-webkit-scrollbar,
#markdown-viewer-body::-webkit-scrollbar {
    width: 10px;
}

#file-explorer-left-content::-webkit-scrollbar-track,
#file-explorer-right-content::-webkit-scrollbar-track,
#markdown-viewer-body::-webkit-scrollbar-track {
    background: #001010;
}

#file-explorer-left-content::-webkit-scrollbar-thumb,
#file-explorer-right-content::-webkit-scrollbar-thumb,
#markdown-viewer-body::-webkit-scrollbar-thumb {
    background: #004080;
    border: 1px solid #006060;
}

#file-explorer-left-content::-webkit-scrollbar-thumb:hover,
#file-explorer-right-content::-webkit-scrollbar-thumb:hover,
#markdown-viewer-body::-webkit-scrollbar-thumb:hover {
    background: #0060a0;
}

/* Fade animations */
.fade-out {
    animation: fadeOut 0.5s ease-out;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

