/* VMO HTML to PDF - Publisher UI */
:root {
    --vmo-dark: #0f172a;
    --vmo-panel: #1e293b;
    --vmo-accent: #06b6d4;
    --vmo-text: #f1f5f9;
    --vmo-border: #334155;
}

.vmo-pdf-wrapper {
    background: var(--vmo-dark);
    color: var(--vmo-text);
    padding: 20px;
    border-radius: 8px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin-top: 20px;
}

.vmo-pdf-toolbar {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--vmo-panel);
    border-bottom: 1px solid var(--vmo-border);
    border-radius: 8px 8px 0 0;
    align-items: center;
    flex-wrap: wrap;
}

.vmo-tool-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 15px;
    border-right: 1px solid var(--vmo-border);
}

.vmo-tool-group:last-child {
    border-right: none;
}

.vmo-pdf-workstation {
    display: flex;
    height: 80vh;
    border: 1px solid var(--vmo-border);
    border-top: none;
}

.vmo-editor-pane, .vmo-preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vmo-editor-pane {
    border-right: 1px solid var(--vmo-border);
    background: #0f172a;
}

.vmo-code-editor {
    width: 100%;
    height: 100%;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
}

.vmo-code-editor:focus {
    outline: 2px solid var(--vmo-accent);
}

.vmo-preview-pane {
    background: #525659; /* Acrobat gray */
    padding: 40px;
    overflow-y: auto;
    align-items: center;
}

/* The Paper Sheet */
#vmo-pdf-preview {
    background: white;
    width: 210mm; /* Default A4 width */
    min-height: 297mm; /* Default A4 height */
    padding: 20mm;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: black;
    transform-origin: top center;
    transition: width 0.3s, min-height 0.3s;
    box-sizing: border-box; /* IMPORTANT: Include padding in width */
}

/* Ensure images don't overflow the paper */
#vmo-pdf-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Form Styles for Selects in Toolbar */
.vmo-select {
    padding: 6px 12px;
    background: #334155;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.vmo-select:focus {
    outline: 2px solid var(--vmo-accent);
}

/* UI Elements */
.vmo-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    background: var(--vmo-panel);
    color: var(--vmo-text);
    border: 1px solid var(--vmo-border);
}

.vmo-btn:hover {
    background: #334155;
}

.vmo-btn.primary {
    background: var(--vmo-accent);
    color: #000;
    border: none;
}

.vmo-btn.primary:hover {
    filter: brightness(1.1);
}

.vmo-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* Generated Elements in PDF */
.vmo-pdf-toc {
    page-break-after: always;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.vmo-pdf-toc h2 {
    border-bottom: 2px solid black;
    padding-bottom: 10px;
}
.vmo-toc-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted #ccc;
    margin-bottom: 8px;
    padding-bottom: 4px;
}
.vmo-toc-link {
    text-decoration: none;
    color: black;
    font-weight: 500;
}

.vmo-media-placeholder {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    margin: 15px 0;
    font-family: sans-serif;
    page-break-inside: avoid;
}

.vmo-media-icon {
    width: 40px;
    height: 40px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.vmo-media-info h4 {
    margin: 0 0 4px 0;
    color: #0f172a;
}
.vmo-media-info a {
    color: #0284c7;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
}
.vmo-media-info a:hover {
    text-decoration: underline;
}

.vmo-page-number {
    position: absolute;
    bottom: 10mm;
    right: 20mm;
    font-size: 10pt;
    color: #666;
}

/* Helper for animations in PDF (Visual Only) */
@keyframes spin { 100% { transform: rotate(360deg); } }
.vmo-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s linear infinite;
}
