/* ==========================================
   Editor styles (Generic - Dark Theme)
   Square tabs, full height, no borders, with reload button
   FIXED: Scrollable tabs when screen is narrow
   ========================================== */

.editor-container {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #1e1e1e;
}

.tab-content.edit-mode .editor-container {
    display: flex;
}

.tab-content.edit-mode .preview-container {
    display: none;
}

/* Editor Header - Square tabs with horizontal scroll */
.editor-header {
    display: block; /* Changed from flex to block */
    height: 48px;
    padding: 0;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap; /* Prevent wrapping */
}

/* Scrollbar styling */
.editor-header::-webkit-scrollbar {
    height: 6px;
}

.editor-header::-webkit-scrollbar-track {
    background: #252526;
}

.editor-header::-webkit-scrollbar-thumb {
    background: #3e3e42;
    border-radius: 3px;
}

.editor-header::-webkit-scrollbar-thumb:hover {
    background: #4e4e52;
}

.editor-tabs {
    display: inline-flex; /* Changed to inline-flex */
    gap: 0;
    height: 48px;
    vertical-align: top;
}

.editor-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: 48px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    color: #cccccc;
    transition: all 0.2s;
    white-space: nowrap;
    gap: 8px;
    position: relative;
    flex-shrink: 0; /* Prevent tabs from shrinking */
}

.editor-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.editor-tab.active {
    background: #0e639c;
    color: white;
    font-weight: 500;
}

/* Editor Tab Label */
.editor-tab-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Reload button inside tab */
.editor-tab-reload {
    opacity: 0;
    font-size: 13px;
    padding: 3px 6px;
    border-radius: 3px;
    transition: all 0.2s;
    cursor: pointer;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.editor-tab:hover .editor-tab-reload {
    opacity: 0.6;
}

.editor-tab-reload:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.2);
}

.editor-tab.active .editor-tab-reload {
    opacity: 0.7;
}

.editor-tab.active .editor-tab-reload:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.25);
}

/* Editor Content */
.editor-content {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    position: relative;
    background: #1e1e1e;
}

.editor-panel {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.editor-panel.active {
    display: block;
}

/* Plugin Content Wrapper (Generic) */
.plugin-content-wrapper {
    height: 100%;
    overflow-y: auto;
    background: #1e1e1e;
    color: #cccccc;
}

/* Plugin Placeholder (when not yet loaded) */
.plugin-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #858585;
    text-align: center;
    padding: 40px;
}

.plugin-placeholder p {
    margin: 10px 0;
    font-size: 16px;
}

.plugin-placeholder .hint {
    font-size: 14px;
    color: #6a6a6a;
}

/* Loading State */
.plugin-content-wrapper .loading {
    text-align: center;
    padding: 50px;
    color: #858585;
    font-size: 14px;
}

/* No Plugins Message */
.no-plugins-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #858585;
    padding: 40px;
}

.no-plugins-message p {
    margin: 10px 0;
    font-size: 16px;
}

.no-plugins-message .hint {
    font-size: 14px;
    color: #6a6a6a;
}

.no-plugins-message code {
    background: #2d2d30;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: monospace;
    color: #d7ba7d;
}

/* Plugin Error States (Generic) */
.plugin-error {
    padding: 20px;
    background: #3c2b23;
    border: 1px solid #a85a3c;
    border-radius: 5px;
    color: #f48771;
    margin: 20px;
}

.plugin-empty {
    padding: 40px;
    text-align: center;
    color: #858585;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-header {
        height: 44px;
    }
    
    .editor-tab {
        padding: 0 12px;
        font-size: 12px;
        height: 44px;
    }
    
    .editor-tab-reload {
        font-size: 12px;
        padding: 2px 4px;
    }
    
    .plugin-placeholder,
    .no-plugins-message {
        padding: 30px 20px;
    }
    
    .plugin-placeholder p,
    .no-plugins-message p {
        font-size: 14px;
    }
}