.editor-container {
    width: 245px;
    height: 420px;
    min-width: 245px;
    /* Set minimum width */
    min-height: 420px;
    /* Set minimum height */
    position: fixed;
    bottom: 20px;
    margin-left: 20px;
    transform: scale(0);
    transform-origin: bottom left;
    transition: transform 0.3s ease-in-out;
    background-color: #2c2c2c;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.editor-container.expanded {
    transform: scale(1);
}

.editor-header {
    background-color: #2c2c2c;
    color: #fff;
    padding: 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.download-button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

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

#showEditor {
    position: fixed;
    bottom: 20px;
    margin-left: 20px;
    z-index: 2;
}

.editor-content {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

#editor {
    position: absolute;
    top: 0;
    left: 35px;
    right: 0;
    bottom: 0;
    border: none;
    background-color: #1e1e1e;
    color: #f8f8f8;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    padding: 10px;
    resize: none;
    outline: none;
    overflow-y: auto;
    white-space: pre;
    line-height: 1.5;
}

/* 簡潔的代碼編輯器滾動條 */

/* 整體滾動條 - 非常細的設計 */
#editor::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: transparent;
  }
  
  /* 滾動條軌道 - 幾乎不可見 */
  #editor::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.2);
    border-radius: 4px;
  }
  
  /* 滾動條游標 - 簡潔設計 */
  #editor::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
    border: 1px solid rgba(20, 20, 20, 0.5);
  }
  
  /* 游標懸停效果 */
  #editor::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
  
  /* 游標按下效果 */
  #editor::-webkit-scrollbar-thumb:active {
    background: #666;
  }
  
  /* 隱藏滾動條按鈕和角落 */
  #editor::-webkit-scrollbar-button,
  #editor::-webkit-scrollbar-corner {
    display: none;
  }
  
  /* Firefox 支持 */
  #editor {
    /* scrollbar-width: thin; */
    scrollbar-color: #444 transparent;
  }
  
  /* 讓滾動條在不滾動時變得半透明 */
  #editor:not(:hover)::-webkit-scrollbar-thumb {
    background: rgba(68, 68, 68, 0.6);
  }
  
  /* 滾動時顯示完整不透明度的滾動條 */
  #editor:hover::-webkit-scrollbar-thumb {
    background: rgba(68, 68, 68, 1);
  }

.line-numbers {
    position: absolute;
    top: 0;
    left: 0;
    width: 35px;
    height: 100%;
    background-color: #252525;
    color: #606366;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    padding: 10px 5px;
    box-sizing: border-box;
    user-select: none;
    overflow: hidden;
}

.resize-handle {
    position: absolute;
    background: transparent;
}

.resize-handle.top {
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    cursor: ns-resize;
}

.resize-handle.right {
    top: 0;
    right: 0;
    bottom: 0;
    width: 5px;
    cursor: ew-resize;
}

.resize-handle.corner {
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: nesw-resize;
}

.storage-toggle {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.storage-toggle label {
    margin-right: 10px;
}

.storage-toggle input[type="checkbox"] {
    appearance: none;
    width: 50px;
    height: 20px;
    background-color: #cccccc00;
    border-radius: 3px;
    border: 1px solid #ccc;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.storage-toggle input[type="checkbox"]:checked {
    background-color: #ffffff;
}

.storage-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 15px;
    border-radius: 2px;
    top: 2px;
    left: 3px;
    background-color: rgb(181, 181, 181);
    transition: transform 0.3s;
}

.storage-toggle input[type="checkbox"]:checked::before {
    transform: translateX(22px);
}

#fileInput {
    content: 'Import';
}

#filenameInputContainer {
    width: 100%;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

#filenameInputContainer.hidden {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#filenameInputContainer.visible {
    transform: translateY(-15px);
    opacity: 1;
    pointer-events: auto;
}

#filenameInput {
    position: absolute;
    width: 200px;
    transform: translateY(-15px);
    left: calc(48% - 100px);
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.custom-file-label {
    display: inline-block;
    padding: 5px 8px;
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 3px;
    border: 1px solid #ffffff;
    cursor: pointer;
    text-align: center;
    z-index: 1;
}

.custom-file-label:hover {
    color: black;
    background-color: #ffffff;
}

#jsonEXBtn {
    display: inline-block;
    padding: 5px 8px;
    font-size: 14px;
    background-color: #ffffff00;
    color: white;
    border-radius: 3px;
    border: 1px solid #ffffff;
    cursor: pointer;
    text-align: center;
    z-index: 1;
}

#jsonEXBtn:hover {
    background-color: #a6a6a6;
}

.horizontal-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px; /* 控制按鈕之間的間距 */
}

.horizontal-buttons button,
.horizontal-buttons .custom-file-label {
    flex: 1; /* 讓按鈕等寬 */
    text-align: center;
}