/* --- Web Editor Widget Styles --- */
/* Extracted from original web-editor/index.html */

.web-editor-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    display: flex;
    min-height: 500px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f4f7f9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
    box-sizing: border-box;
}

.web-editor-widget * {
    box-sizing: border-box;
}

.web-editor-widget .editor-container {
    width: 50%;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    min-width: 440px;
}

.web-editor-widget .tabs {
    display: flex;
    align-items: center;
    background-color: #f3f4f6;
    padding: 10px 10px 0;
    border-bottom: 1px solid #d1d5db;
    flex-shrink: 0;
}

.web-editor-widget .tab {
    padding: 10px 15px;
    cursor: pointer;
    color: #4b5563;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border-bottom: none;
    margin-right: 4px;
    font-size: 14px;
    background: #e5e7eb;
}

.web-editor-widget .tab.active {
    background-color: #ffffff;
    color: #111827;
    position: relative;
    margin-bottom: -1px;
    border-bottom-color: #ffffff;
}

.web-editor-widget .tab-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.web-editor-widget .control-btn {
    background: #e5e7eb;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}
.web-editor-widget .control-btn:hover { background: #d1d5db; }
.web-editor-widget .control-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.web-editor-widget .control-btn svg { width: 16px; height: 16px; }

.web-editor-widget .editor-panels {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.web-editor-widget .panel {
    display: none;
    height: 100%;
    overflow-y: auto;
    flex-direction: column;
}
.web-editor-widget .panel.active { display: flex; }

.web-editor-widget .html-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f9fafb;
}

.web-editor-widget .non-editable {
    background-color: #f9fafb;
    user-select: none;
    color: #6b7280;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 10px 15px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
    flex-shrink: 0;
}

/* Syntax Highlighting Overlay Styles */
.web-editor-widget .highlight-wrapper {
    position: relative;
    background-color: #ffffff;
}

.web-editor-widget .html-editor .highlight-wrapper {
        flex-shrink: 0;
}

.web-editor-widget .panel[data-panel="css"] .highlight-wrapper,
.web-editor-widget .panel[data-panel="js"] .highlight-wrapper {
    flex-grow: 1;
    border-bottom-left-radius: 7px;
}

.web-editor-widget .highlight-wrapper:focus-within {
    box-shadow: 0 0 0 1px #4b5563 inset;
}

.web-editor-widget .highlight-textarea, .web-editor-widget .highlight-pre {
    margin: 0;
    padding: 10px 15px;
    border: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    width: 100%;
    /* Fixes for misalignment: */
    font-variant-ligatures: none;
    font-feature-settings: normal;
    letter-spacing: 0;
    tab-size: 4;
    -moz-tab-size: 4;
}

.web-editor-widget .html-editor .highlight-textarea,
.web-editor-widget .html-editor .highlight-pre {
    padding-left: calc(15px + 4ch);
}

.web-editor-widget .highlight-textarea {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: transparent;
    color: transparent;
    caret-color: #333;
    resize: none;
    height: 100%;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.web-editor-widget .highlight-textarea::-webkit-scrollbar {
    display: none;
}
.web-editor-widget .highlight-textarea {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.web-editor-widget .highlight-pre {
    position: relative;
    z-index: 0;
    overflow: hidden;
    min-height: 1.5em;
    background: transparent;
}

.web-editor-widget .panel[data-panel="css"] .highlight-pre,
.web-editor-widget .panel[data-panel="js"] .highlight-pre {
    height: 100%;
    overflow: auto;
}

/* Prism.js syntax highlighting style overrides */
.web-editor-widget code[class*="language-"],
.web-editor-widget pre[class*="language-"] {
    color: #393a34;
    text-shadow: none;
    background: none;
    /* Inherit font settings from parent to prevent drift */
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    font-variant-ligatures: inherit;
    letter-spacing: inherit;
    /* Override potential global styles to prevent misalignment */
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.web-editor-widget .token.comment, .web-editor-widget .token.prolog, .web-editor-widget .token.doctype, .web-editor-widget .token.cdata { color: slategray; }
.web-editor-widget .token.punctuation { color: #999; }
.web-editor-widget .token.namespace { opacity: .7; }
.web-editor-widget .token.property, .web-editor-widget .token.tag, .web-editor-widget .token.boolean, .web-editor-widget .token.number, .web-editor-widget .token.constant, .web-editor-widget .token.symbol, .web-editor-widget .token.deleted { color: #990055; }
.web-editor-widget .token.selector, .web-editor-widget .token.attr-name, .web-editor-widget .token.string, .web-editor-widget .token.char, .web-editor-widget .token.builtin, .web-editor-widget .token.inserted { color: #690; }
.web-editor-widget .token.operator, .web-editor-widget .token.entity, .web-editor-widget .token.url, .web-editor-widget .language-css .token.string, .web-editor-widget .style .token.string { color: #a67f59; }
.web-editor-widget .token.atrule, .web-editor-widget .token.attr-value, .web-editor-widget .token.keyword { color: #07a; }
.web-editor-widget .token.function, .web-editor-widget .token.class-name { color: #DD4A68; }
.web-editor-widget .token.regex, .web-editor-widget .token.important, .web-editor-widget .token.variable { color: #e90; }

.web-editor-widget .preview-container {
    width: 50%;
    background-size: cover;
    background-position: center;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 440px;
}

.web-editor-widget .resizer {
    flex-shrink: 0;
    width: 5px;
    background: #e5e7eb;
    cursor: col-resize;
    transition: background-color 0.2s;
}
.web-editor-widget .resizer:hover {
    background: #d1d5db;
}
.web-editor-widget .resizer.disabled {
    cursor: default;
}
.web-editor-widget .resizer.disabled:hover {
    background: #e5e7eb;
}

.web-editor-widget .browser-window {
    width: 100%;
    height: 100%;
    background-color: #f3f4f6;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.web-editor-widget .browser-header {
    padding: 10px 10px 0 10px;
    flex-shrink: 0;
}

.web-editor-widget .browser-tab {
    display: inline-block;
    background-color: #ffffff;
    padding: 8px 16px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    color: #374151;
    font-weight: 500;
    font-size: 13px;
    user-select: none;
}

.web-editor-widget .address-bar-container {
    background-color: white;
    padding: 10px 10px 10px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid #d1d5db;
}

.web-editor-widget .address-bar {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 12px;
    color: #4b5563;
    font-size: 13px;
    user-select: none;
}

.web-editor-widget .preview-content {
    flex-grow: 1;
    border: none;
    background-color: #fff;
    width: 100%;
}

/* Loading Overlay for Dynamic Resources */
.web-editor-widget .loading-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 50;
    display: flex; justify-content: center; align-items: center;
    font-family: sans-serif; color: #666;
}

/* Namespaced PDF Modal Styles */
.we-pdf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}
.we-pdf-modal-overlay.visible {
    visibility: visible;
    opacity: 1;
}
.we-pdf-modal {
    background: white;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.we-pdf-modal h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #111827;
}
.we-pdf-modal .we-form-group {
    margin-bottom: 16px;
}
.we-pdf-modal .we-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #374151;
}
.we-pdf-modal .we-form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-sizing: border-box;
}
.we-pdf-modal .we-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.we-pdf-modal .we-modal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.we-pdf-modal .we-modal-btn-primary {
    background-color: #2563eb;
    color: white;
}
.we-pdf-modal .we-modal-btn-secondary {
    background-color: #e5e7eb;
    color: #111827;
}