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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    gap: 10px;
    padding: 10px;
}

.left-panel {
    width: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    background-color: #007acc;
    color: white;
    padding: 8px;
    font-weight: bold;
    text-align: center;
}

.tree-view {
    padding: 10px;
    height: calc(100% - 60px);
    overflow-y: auto;
}

.tree-item {
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 4px;
    margin: 1px 0;
    transition: background-color 0.2s;
    user-select: none;
}

.tree-item:hover {
    background-color: #e3f2fd;
}

.tree-item.selected {
    background-color: #2196f3;
    color: white;
}

.tree-item.category {
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    margin-top: 6px;
    cursor: pointer;
    position: relative;
    padding-right: 30px;
}

.tree-item.category:first-child {
    margin-top: 0;
}

.tree-item.category::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    font-size: 12px;
}

.tree-item.category.collapsed::after {
    transform: translateY(-50%) rotate(-90deg);
}

.tree-item.category:hover {
    background-color: #e0e0e0;
}

.tree-item.sub-item {
    margin-left: 20px;
    padding-left: 16px;
    border-left: 2px solid #ddd;
    max-height: 32px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.tree-item.sub-item.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.right-panel {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.right-header {
    background-color: #007acc;
    color: white;
    padding: 8px;
    font-weight: bold;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
}

.copy-button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.copy-button:hover {
    background-color: #45a049;
}

.copy-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.text-content {
    flex: 1;
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.text-box {
    width: 100%;
    height: 100%;
    /* border: 1px solid #ddd; */
    /* border-radius: 4px; */
    /* padding: 15px; */
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    /* background-color: #fafafa; */
    resize: none;
    outline: none;
    overflow-y: auto;
}

.text-box:focus {
    border-color: #007acc;
    box-shadow: 0 0 5px rgba(0, 122, 204, 0.3);
}

.status-message {
    padding: 10px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.error {
    color: #d32f2f;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Markdownコンテンツ用のスタイル */
.markdown-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.markdown-content .placeholder {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.markdown-content h1 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007acc;
}

.markdown-content h2 {
    font-size: 1.4em;
    color: #444;
    margin: 20px 0 12px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.markdown-content h3 {
    font-size: 1.2em;
    color: #555;
    margin: 16px 0 8px 0;
}

.markdown-content p {
    margin-bottom: 12px;
    color: #333;
}

.markdown-content code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.markdown-content pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.code-block-container {
    position: relative;
    margin: 12px 0;
}

.code-copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.2s ease;
    opacity: 0.7;
    z-index: 10;
}

.code-copy-button:hover {
    background-color: #5a6268;
    opacity: 1;
}

.code-copy-button:active {
    background-color: #495057;
}

.code-copy-button.copied {
    background-color: #28a745;
}

.code-copy-button.copied:hover {
    background-color: #218838;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #333;
    font-size: inherit;
}

.markdown-content ul,
.markdown-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

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

.markdown-content blockquote {
    border-left: 4px solid #007acc;
    margin: 12px 0;
    padding: 8px 16px;
    background-color: #f0f8ff;
    color: #555;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.markdown-content th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.markdown-content a {
    color: #007acc;
    text-decoration: none;
}

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

/* Prism.js syntax highlighting customization */
.markdown-content pre[class*="language-"] {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.markdown-content code[class*="language-"] {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    background: none;
    padding: 0;
}

/* シンタックスハイライトの色をカスタマイズ */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6a9955;
    font-style: italic;
}

.token.punctuation {
    color: #333;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #0969da;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #032f62;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #d73a49;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #d73a49;
}

.token.function,
.token.class-name {
    color: #6f42c1;
}

.token.regex,
.token.important,
.token.variable {
    color: #e36209;
}

.token.important,
.token.bold {
    font-weight: bold;
}

.token.italic {
    font-style: italic;
}

.token.entity {
    cursor: help;
}

/* 特定の言語向けのカスタマイズ */
.language-csharp .token.keyword {
    color: #0000ff;
}

.language-csharp .token.string {
    color: #a31515;
}

.language-javascript .token.keyword {
    color: #0000ff;
}

.language-javascript .token.function {
    color: #795e26;
}
