/* PREF Document Editor - Styles */

.pref-doc-editor-wrap {
    font-family: 'Georgia', serif;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    border: 1px solid #e0d6c8;
    background: #fff;
    margin: 24px 0;
}

/* Header */
.pref-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1a3a2a;
    color: #fff;
    gap: 12px;
    flex-wrap: wrap;
}

.pref-editor-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #e8dfc8;
    letter-spacing: 0.01em;
    flex: 1;
    min-width: 0;
}

.pref-editor-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pref-editor-title svg {
    flex-shrink: 0;
    color: #a8c5a0;
}

.pref-editor-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Buttons */
.pref-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 7px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
    letter-spacing: 0.02em;
}

.pref-btn-primary {
    background: #c8a84b;
    color: #1a2a1a;
}

.pref-btn-primary:hover {
    background: #d4b55a;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(200,168,75,0.35);
}

.pref-btn-secondary {
    background: rgba(255,255,255,0.12);
    color: #e8dfc8;
    border: 1px solid rgba(255,255,255,0.2);
}

.pref-btn-secondary:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Loading */
.pref-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7c6b;
    gap: 14px;
    font-size: 14px;
}

.pref-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0d6c8;
    border-top-color: #1a3a2a;
    border-radius: 50%;
    animation: pref-spin 0.8s linear infinite;
}

@keyframes pref-spin {
    to { transform: rotate(360deg); }
}

/* Error */
.pref-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #8b4a3a;
    gap: 12px;
    text-align: center;
}

.pref-error svg {
    color: #c87a6a;
}

.pref-error-msg {
    font-size: 15px;
    color: #6b4a3a;
    margin: 0;
}

/* Quill Editor Overrides */
.pref-quill-wrap {
    background: #f5f0e8;
    padding: 0;
}

.pref-quill-wrap .ql-toolbar {
    background: #f0ebe0;
    border: none;
    border-bottom: 1px solid #ddd5c0;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pref-quill-wrap .ql-container {
    background: #fff;
    border: none;
    font-family: 'Georgia', serif;
    font-size: 15px;
    line-height: 1.8;
}

.pref-quill-wrap .ql-editor {
    padding: 40px 60px;
    max-width: 860px;
    margin: 0 auto;
    min-height: 100%;
    color: #1a1a1a;
}

/* Responsive */
@media (max-width: 600px) {
    .pref-quill-wrap .ql-editor {
        padding: 24px 20px;
    }

    .pref-editor-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pref-editor-actions {
        width: 100%;
    }

    .pref-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .pref-doc-editor-wrap {
        box-shadow: none;
        border: none;
    }

    .pref-editor-header,
    .pref-quill-wrap .ql-toolbar {
        display: none !important;
    }

    .pref-quill-wrap .ql-editor {
        padding: 0;
    }
}

/* ── Toggle Button ── */
.pref-editor-outer {
    margin: 20px 0;
}

.pref-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 22px;
    background: #1a3a2a;
    color: #e8dfc8;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(26,58,42,0.18);
}

.pref-toggle-btn:hover {
    background: #24502e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26,58,42,0.28);
}

.pref-toggle-btn.is-open {
    background: #8b4a3a;
    color: #fce8e0;
    box-shadow: 0 2px 8px rgba(139,74,58,0.22);
}

.pref-toggle-btn.is-open:hover {
    background: #a05540;
}

/* Slide animation for editor panel */
.pref-doc-editor-wrap {
    animation: pref-slide-down 0.28s ease;
    margin-top: 12px;
}

@keyframes pref-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
