/**
 * SJC WYSIWYG Editor Styles
 */

.wysiwyg-container {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wysiwyg-container:focus-within {
    border-color: #003049;
    box-shadow: 0 0 0 3px rgba(0, 48, 73, 0.12);
}

/* Toolbar */
.wysiwyg-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    padding: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.wysiwyg-btn-group {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px;
    margin-right: 4px;
}

.wysiwyg-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    height: 28px;
    min-width: 28px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.12s ease, color 0.12s ease;
    line-height: 1;
}

.wysiwyg-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.wysiwyg-btn.is-active {
    background: #003049;
    color: #ffffff;
}

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

.wysiwyg-select {
    height: 28px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

.wysiwyg-select:focus {
    border-color: #003049;
}

/* Content Editable Area */
.wysiwyg-content {
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    padding: 12px 14px;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    box-sizing: border-box;
}

.wysiwyg-content p {
    margin: 0 0 10px 0;
}

.wysiwyg-content p:last-child {
    margin-bottom: 0;
}

.wysiwyg-content h2,
.wysiwyg-content h3,
.wysiwyg-content h4 {
    color: #003049;
    margin: 14px 0 8px 0;
    font-weight: 700;
    line-height: 1.3;
}

.wysiwyg-content h2 { font-size: 1.35rem; }
.wysiwyg-content h3 { font-size: 1.15rem; }
.wysiwyg-content h4 { font-size: 1.02rem; }

.wysiwyg-content ul,
.wysiwyg-content ol {
    margin: 8px 0 12px 24px;
    padding: 0;
}

.wysiwyg-content li {
    margin-bottom: 4px;
}

.wysiwyg-content blockquote {
    border-left: 3px solid #003049;
    background: #f1f5f9;
    margin: 10px 0;
    padding: 8px 14px;
    color: #475569;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

.wysiwyg-content a {
    color: #0284c7;
    text-decoration: underline;
}

.wysiwyg-content a:hover {
    color: #0369a1;
}

.wysiwyg-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
    display: inline-block;
}

/* Source View (Raw HTML) */
.wysiwyg-source {
    display: none;
    width: 100%;
    min-height: 200px;
    max-height: 600px;
    padding: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #0f172a;
    background: #f8fafc;
    border: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    outline: none;
    box-sizing: border-box;
    resize: vertical;
}

/* Modal Dialogs */
.wysiwyg-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.wysiwyg-modal {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: wysiwygFadeIn 0.15s ease-out;
}

@keyframes wysiwygFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.wysiwyg-modal-header {
    background: #003049;
    color: #ffffff;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wysiwyg-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.wysiwyg-modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.wysiwyg-modal-close:hover {
    color: #ffffff;
}

.wysiwyg-modal-body {
    padding: 18px;
}

.wysiwyg-modal-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
    gap: 8px;
}

.wysiwyg-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    margin-bottom: -2px;
}

.wysiwyg-tab-btn.is-active {
    color: #003049;
    border-bottom-color: #003049;
}

.wysiwyg-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wysiwyg-dropzone:hover,
.wysiwyg-dropzone.is-dragover {
    border-color: #003049;
    background: #f0fdf4;
}

.wysiwyg-modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 12px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

