/* ============================================
   PDF Tools - Editor Styles
   ============================================ */

.editor-body {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Editor Header */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    height: 56px;
    flex-shrink: 0;
}

.editor-header-left,
.editor-header-center,
.editor-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.editor-header-left {
    flex: 1;
}

.editor-header-right {
    flex: 1;
    justify-content: flex-end;
}

.editor-file-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: var(--space-4);
    padding-left: var(--space-4);
    border-left: 1px solid var(--border-subtle);
}

.editor-filename {
    font-weight: 500;
    color: var(--text-primary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-saved {
    color: var(--success);
    font-size: 8px;
}

.editor-saved.unsaved {
    color: var(--warning);
}

.editor-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.editor-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.editor-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.editor-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
    margin: 0 var(--space-2);
}

.zoom-level {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Editor Container */
.editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Toolbar */
.editor-toolbar {
    width: 56px;
    background: var(--surface);
    border-right: 1px solid var(--border-subtle);
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.toolbar-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-2) 0;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tool-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tool-btn.active {
    background: var(--primary-glow);
    color: var(--primary);
}

.tool-btn svg {
    width: 20px;
    height: 20px;
}

/* Main Canvas Area */
.editor-main {
    flex: 1;
    background: var(--bg-secondary);
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.editor-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--space-8);
}

.pdf-canvas-wrapper {
    position: relative;
    box-shadow: var(--shadow-xl);
    background: white;
}

.pdf-canvas-wrapper canvas {
    display: block;
}

#fabricCanvas {
    position: absolute;
    top: 0;
    left: 0;
}

/* Right Properties Panel */
.editor-properties {
    width: 260px;
    background: var(--surface);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.properties-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.properties-header h3 {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
}

.properties-content {
    padding: var(--space-4);
    overflow-y: auto;
    flex: 1;
}

.property-group {
    margin-bottom: var(--space-5);
}

.property-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.property-group input[type="range"] {
    width: 100%;
    margin-bottom: var(--space-1);
}

.property-group input[type="number"] {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.color-picker {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.color-picker input[type="color"] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
}

.color-picker span {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Page Thumbnails */
.page-thumbnails {
    height: 100px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    overflow-x: auto;
    flex-shrink: 0;
}

.page-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
    background: white;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    position: relative;
}

.page-thumb:hover {
    border-color: var(--border-color);
}

.page-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.page-thumb canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-thumb-number {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

/* Responsive */
@media (max-width: 1024px) {
    .editor-properties {
        display: none;
    }
}

@media (max-width: 768px) {
    .editor-header-center {
        display: none;
    }

    .editor-toolbar {
        width: 48px;
        padding: var(--space-1);
    }

    .tool-btn {
        width: 36px;
        height: 36px;
    }

    .tool-btn svg {
        width: 18px;
        height: 18px;
    }

    .page-thumbnails {
        height: 80px;
    }

    .page-thumb {
        width: 45px;
        height: 60px;
    }
}