/* UniPub Pro - World-Class IDE Editor Styles */

.editor-pane {
    background: #0d1117 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Editor Tabs System */
.editor-tabs {
    display: flex;
    background: #010409;
    border-bottom: 1px solid #30363d;
    overflow-x: auto;
    min-height: 40px;
    align-items: stretch;
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-right: 1px solid #30363d;
    color: #8b949e;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
}

.editor-tab:hover {
    background: #161b22;
    color: #f0f6fc;
}

.editor-tab.active {
    background: #0d1117;
    color: #f0f6fc;
    border-bottom: 2px solid #3b82f6;
}

.editor-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3b82f6;
}

.editor-tab i {
    font-size: 1rem;
}

.tab-close {
    margin-left: 0.5rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.tab-close:hover {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

.add-tab-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.2s;
}

.add-tab-btn:hover {
    background: #161b22;
    color: #3b82f6;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #161b22;
    border-bottom: 1px solid #30363d;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.toolbar-btn {
    padding: 0.375rem 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    color: #8b949e;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.toolbar-btn:hover {
    background: #21262d;
    color: #f0f6fc;
    border-color: #30363d;
}

.toolbar-btn.active {
    background: #1f6feb;
    color: white;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #30363d;
    margin: 0 0.5rem;
}

/* Main Editor Container */
.editor-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #0d1117;
}

/* File Explorer Sidebar */
.file-explorer {
    width: 200px;
    background: #010409;
    border-right: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
}

.file-explorer.collapsed {
    width: 0;
    overflow: hidden;
}

.explorer-header {
    padding: 0.75rem;
    border-bottom: 1px solid #30363d;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b949e;
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.tree-item {
    padding: 0.375rem 0.5rem;
    color: #8b949e;
    cursor: pointer;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.tree-item:hover {
    background: #161b22;
    color: #f0f6fc;
}

.tree-item.active {
    background: #1f6feb;
    color: white;
}

.tree-item i {
    font-size: 1rem;
}

/* CodeMirror Container */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.CodeMirror {
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
}

/* Dark Theme for CodeMirror */
.cm-s-dracula.CodeMirror {
    background: #0d1117 !important;
    color: #f8f8f2 !important;
}

.cm-s-dracula .CodeMirror-gutters {
    background: #010409 !important;
    border-right: 1px solid #30363d !important;
}

.cm-s-dracula .CodeMirror-linenumber {
    color: #6272a4 !important;
}

.cm-s-dracula .CodeMirror-cursor {
    border-left: 2px solid #f8f8f2 !important;
}

.cm-s-dracula .CodeMirror-selected {
    background: rgba(255, 255, 255, 0.1) !important;
}

.cm-s-dracula .cm-keyword {
    color: #ff79c6 !important;
}

.cm-s-dracula .cm-string {
    color: #f1fa8c !important;
}

.cm-s-dracula .cm-comment {
    color: #6272a4 !important;
}

.cm-s-dracula .cm-variable {
    color: #50fa7b !important;
}

.cm-s-dracula .cm-number {
    color: #bd93f9 !important;
}

.cm-s-dracula .cm-def {
    color: #50fa7b !important;
}

.cm-s-dracula .cm-operator {
    color: #ff79c6 !important;
}

.cm-s-dracula .cm-tag {
    color: #ff79c6 !important;
}

.cm-s-dracula .cm-attribute {
    color: #50fa7b !important;
}

/* Editor Status Bar */
.editor-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 1rem;
    background: #010409;
    border-top: 1px solid #30363d;
    font-size: 0.75rem;
    color: #8b949e;
}

.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-item i {
    font-size: 0.875rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3fb950;
}

.status-indicator.modified {
    background: #f85149;
}

.status-indicator.saving {
    background: #f0883e;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Quick Actions Panel */
.quick-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 0.5rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.editor-container:hover .quick-actions {
    opacity: 1;
}

.quick-action-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: #8b949e;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-action-btn:hover {
    background: #21262d;
    color: #58a6ff;
}

/* Format Selector */
.format-selector {
    padding: 0.375rem 0.75rem;
    background: #161b22;
    border: 1px solid #30363d;
    color: #f0f6fc;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Minimap */
.editor-minimap {
    width: 100px;
    background: #010409;
    border-left: 1px solid #30363d;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.editor-minimap:hover {
    opacity: 1;
}

/* Breadcrumb */
.editor-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0d1117;
    border-bottom: 1px solid #30363d;
    font-size: 0.875rem;
    color: #8b949e;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.breadcrumb-separator {
    color: #30363d;
}

/* Enhanced Upload Area */
.enhanced-upload {
    border: 2px dashed #30363d;
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, transparent 25%, rgba(59, 130, 246, 0.02) 25%, rgba(59, 130, 246, 0.02) 50%, transparent 50%, transparent 75%, rgba(59, 130, 246, 0.02) 75%);
    background-size: 20px 20px;
    animation: move-bg 1s linear infinite;
    animation-play-state: paused;
}

.enhanced-upload:hover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
    animation-play-state: running;
}

@keyframes move-bg {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

.upload-icon {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.3));
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #f0f6fc;
}

.upload-subtitle {
    color: #8b949e;
    margin-bottom: 1rem;
}

.supported-formats {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.format-badge {
    padding: 0.25rem 0.5rem;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: #58a6ff;
}

/* Find & Replace Dialog */
.find-replace {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 0.5rem;
    padding: 1rem;
    width: 300px;
    display: none;
    z-index: 100;
}

.find-replace.active {
    display: block;
}

.find-input,
.replace-input {
    width: 100%;
    padding: 0.5rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0.375rem;
    color: #f0f6fc;
    margin-bottom: 0.5rem;
}

.find-actions {
    display: flex;
    gap: 0.5rem;
}

.find-btn {
    flex: 1;
    padding: 0.5rem;
    background: #1f6feb;
    border: none;
    color: white;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.find-btn:hover {
    background: #58a6ff;
}

/* Monaco Editor Container Styles */
#monacoEditor {
    height: 300px;
    min-height: 300px;
    max-height: 300px;
    border: 1px solid #30363d;
    border-radius: 0.25rem;
    overflow: hidden;
    background: #0d1117;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

/* Hide upload area when Monaco is active */
.editor-pane.monaco-active .quick-upload {
    display: none !important;
}

.editor-pane.monaco-active #monacoEditor {
    display: block !important;
}



/* Fix author section visibility */
.author-section {
    margin: 1rem 0 !important;
    padding: 1rem !important;
    background: #161b22 !important;
    border-radius: 0.5rem !important;
    display: flex !important;
    gap: 0.5rem !important;
}

.author-input {
    flex: 1 !important;
    padding: 0.5rem 0.75rem !important;
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
    color: #f0f6fc !important;
    border-radius: 0.25rem !important;
    font-size: 0.875rem !important;
}

/* Fix transform section visibility */
.transform-section {
    margin: 1rem 0 !important;
    padding: 1rem !important;
    background: #161b22 !important;
    border-radius: 0.5rem !important;
    display: block !important;
}

.transform-section h4 {
    margin-bottom: 0.75rem !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #8b949e !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.transform-buttons {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
}

.transform-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: 0.75rem 0.5rem !important;
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
    color: #f0f6fc !important;
    border-radius: 0.25rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-align: center !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

.transform-btn:hover {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.transform-btn i {
    font-size: 1.25rem !important;
    color: #3b82f6 !important;
}

.transform-btn:hover i {
    color: white !important;
}

/* Ensure pane content scrolls properly */
.editor-pane .pane-content {
    overflow-y: auto !important;
    max-height: calc(100vh - 200px) !important;
    padding: 1rem !important;
}




/* Better Editor Toolbar */
.editor-toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 1rem !important;
    background: #161b22 !important;
    border-bottom: 1px solid #30363d !important;
    gap: 1rem !important;
}

.toolbar-section {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Primary Upload Button */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Secondary Clear Button */
.btn-secondary {
    padding: 0.75rem 1.25rem;
    background: #21262d;
    border: 1px solid #30363d;
    color: #f0f6fc;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Tool Buttons */
.btn-tool {
    width: 40px;
    height: 40px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
    cursor: pointer;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-tool:hover {
    background: #30363d;
    color: #58a6ff;
    border-color: #58a6ff;
    transform: scale(1.05);
}

.btn-tool.active {
    background: #1f6feb;
    color: white;
    border-color: #1f6feb;
}

/* Enhanced Upload Area */
.quick-upload {
    border: 3px dashed #3b82f6 !important;
    border-radius: 1rem !important;
    padding: 4rem 2rem !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    margin-bottom: 1.5rem !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.02)) !important;
    position: relative !important;
    overflow: hidden !important;
}

.quick-upload:hover {
    border-color: #2563eb !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05)) !important;
    transform: scale(1.02) !important;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2) !important;
}

.quick-upload.drag-over {
    border-color: #1d4ed8 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08)) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.3) !important;
}

.quick-upload i {
    font-size: 4rem !important;
    color: #3b82f6 !important;
    margin-bottom: 1.5rem !important;
    display: block !important;
    filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.3)) !important;
}

.quick-upload span {
    color: #f0f6fc !important;
    font-size: 1.125rem !important;
    font-weight: 500 !important;
    display: block !important;
    margin-bottom: 1rem !important;
}


