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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: #252526;
    border-right: 1px solid #3e3e42;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-title {
    padding: 0 20px 15px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #858585;
    font-weight: 600;
}

.folder {
    margin-bottom: 5px;
}

.folder-name {
    padding: 5px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #cccccc;
    transition: background 0.2s;
}

.folder-name:hover {
    background: #2a2d2e;
}

.folder-icon {
    margin-right: 6px;
    font-size: 12px;
}

.folder-files {
    display: none;
    padding-left: 20px;
}

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

.folder.open .folder-icon::before {
    content: '📂';
}

.folder-icon::before {
    content: '📁';
}

.file-item {
    padding: 5px 20px;
    cursor: pointer;
    font-size: 13px;
    color: #cccccc;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.file-item:hover {
    background: #2a2d2e;
}

.file-item.active {
    background: #37373d;
    color: #ffffff;
}

.file-icon {
    margin-right: 6px;
}

.file-icon::before {
    content: '📄';
    font-size: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.current-file {
    font-size: 13px;
    color: #cccccc;
    display: flex;
    align-items: center;
}

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

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

/* Markdown Styles - VS Code Dark Theme */
.markdown-body {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #ffffff;
}

.markdown-body h1 {
    font-size: 2em;
    border-bottom: 1px solid #3e3e42;
    padding-bottom: 0.3em;
}

.markdown-body h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #3e3e42;
    padding-bottom: 0.3em;
}

.markdown-body h3 {
    font-size: 1.25em;
}

.markdown-body h4 {
    font-size: 1em;
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body a {
    color: #4fc3f7;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body code {
    background: #3c3c3c;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #f0a368;
    border: 1px solid #4a4a4a;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.markdown-body p code:hover,
.markdown-body li code:hover {
    background: #4a4a4a;
    border-color: #0e639c;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(14, 99, 156, 0.3);
}

.markdown-body p code:active,
.markdown-body li code:active {
    transform: translateY(0);
}

.markdown-body pre {
    background: #2b2b2b;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.markdown-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
    border: none;
}

/* Override specific color for comments - MUST come after pre code style */
.markdown-body pre code .hljs-comment,
.markdown-body pre code .hljs-quote {
    color: #6a9955 !important;
    font-style: italic !important;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 16px;
    padding-left: 2em;
}

.markdown-body li {
    margin-bottom: 4px;
}

.markdown-body blockquote {
    border-left: 4px solid #3e3e42;
    padding-left: 16px;
    margin-bottom: 16px;
    color: #858585;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid #3e3e42;
    padding: 8px 12px;
}

.markdown-body table th {
    background: #2d2d30;
    font-weight: 600;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid #3e3e42;
    margin: 24px 0;
}

/* Copy Button */
.code-block {
    position: relative;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-out;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0e639c;
    border: 1px solid #1177bb;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s;
    opacity: 1;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.copy-button::before {
    content: '📋';
    font-size: 14px;
}

.copy-button::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    border: 1px solid #3e3e42;
    font-weight: normal;
}

.copy-button:hover::after {
    opacity: 1;
}

.copy-button:hover {
    background: #1177bb;
    border-color: #1e88d5;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.copy-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.copy-button.copied {
    background: #107c10;
    border-color: #0f8b0f;
    color: #ffffff;
    animation: pulse 0.3s ease-out;
}

.copy-button.copied::before {
    content: '✓';
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #858585;
}

.welcome-screen h1 {
    font-size: 2.5em;
    margin-bottom: 16px;
    color: #cccccc;
}

.welcome-screen p {
    font-size: 1.1em;
}

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

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #858585;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===================================
   Override highlight.js comment colors to VS Code green
   คอมเม้นต์ทุกภาษาจะเป็นสีเขียว #6a9955
   =================================== */

/* Comment base styles - ใช้กับทุกภาษา */
.hljs-comment,
.hljs-quote,
code .hljs-comment,
code .hljs-quote,
pre code .hljs-comment,
pre code .hljs-quote,
.markdown-body .hljs-comment,
.markdown-body .hljs-quote,
.markdown-body pre code .hljs-comment,
.markdown-body pre code .hljs-quote,
.markdown-body code .hljs-comment,
.markdown-body code .hljs-quote {
    color: #6a9955 !important;
    font-style: italic !important;
}

/* Language-specific comment overrides - เฉพาะแต่ละภาษา */
/* Python/Shell/Bash comments */
.language-python .hljs-comment,
.language-bash .hljs-comment,
.language-sh .hljs-comment,
.language-shell .hljs-comment,
/* JavaScript/C-style comments */
.language-javascript .hljs-comment,
.language-js .hljs-comment,
.language-java .hljs-comment,
.language-cpp .hljs-comment,
.language-c .hljs-comment,
.language-csharp .hljs-comment,
.language-cs .hljs-comment,
/* Web languages */
.language-css .hljs-comment,
.language-html .hljs-comment,
.language-xml .hljs-comment,
/* Database */
.language-sql .hljs-comment,
/* PHP */
.language-php .hljs-comment,
/* Ruby */
.language-ruby .hljs-comment,
.language-rb .hljs-comment,
/* Go */
.language-go .hljs-comment,
/* Rust */
.language-rust .hljs-comment,
/* TypeScript */
.language-typescript .hljs-comment,
.language-ts .hljs-comment {
    color: #6a9955 !important;
    font-style: italic !important;
}

/* Span elements inside code blocks - สำหรับ highlight.js ที่ใช้ span */
span.hljs-comment,
span.hljs-quote,
code span.hljs-comment,
code span.hljs-quote,
pre code span.hljs-comment,
pre code span.hljs-quote {
    color: #6a9955 !important;
    font-style: italic !important;
}

/* Ensure all comment types are green - รวมทุกประเภท comment */
.hljs-comment,
[class*="hljs-comment"],
[class^="hljs-comment"] {
    color: #6a9955 !important;
    font-style: italic !important;
}
