/* ── Shared Rich Text Editor ────────────────────────────────── */
.rte-wrap { position: relative; }

.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 2px solid var(--rte-border, rgba(51,65,85,1));
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}
.rte-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.rte-btn:hover { background: rgba(255,255,255,0.12); color: #f1f5f9; border-color: #2563eb; }
.rte-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.1); margin: 0 2px; flex-shrink: 0; }

.rte-alert-info   { color: #38bdf8 !important; border-color: rgba(56,189,248,0.3) !important; }
.rte-alert-warn   { color: #f59e0b !important; border-color: rgba(245,158,11,0.3) !important; }
.rte-alert-danger { color: #ef4444 !important; border-color: rgba(239,68,68,0.3) !important; }

.rte-editor {
    min-height: 160px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 2px solid var(--rte-border, rgba(51,65,85,1));
    border-radius: 0 0 10px 10px;
    color: #f1f5f9;
    font-size: 14px;
    line-height: 1.7;
    outline: none;
    transition: border-color .2s;
    overflow-y: auto;
}
.rte-editor:focus { border-color: #2563eb; }
.rte-editor [data-alert="info"]    { background:rgba(56,189,248,.08); border-left:3px solid #38bdf8; border-radius:6px; padding:10px 14px; margin:8px 0; }
.rte-editor [data-alert="warning"] { background:rgba(245,158,11,.08); border-left:3px solid #f59e0b; border-radius:6px; padding:10px 14px; margin:8px 0; }
.rte-editor [data-alert="danger"]  { background:rgba(239,68,68,.08);  border-left:3px solid #ef4444; border-radius:6px; padding:10px 14px; margin:8px 0; }

.rte-preview {
    min-height: 100px;
    padding: 14px 16px;
    background: rgba(37,99,235,.05);
    border: 2px solid rgba(37,99,235,.25);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 6px;
}
.rte-preview [data-alert="info"]    { background:rgba(56,189,248,.08); border-left:3px solid #38bdf8; border-radius:6px; padding:10px 14px; margin:8px 0; }
.rte-preview [data-alert="warning"] { background:rgba(245,158,11,.08); border-left:3px solid #f59e0b; border-radius:6px; padding:10px 14px; margin:8px 0; }
.rte-preview [data-alert="danger"]  { background:rgba(239,68,68,.08);  border-left:3px solid #ef4444; border-radius:6px; padding:10px 14px; margin:8px 0; }

/* Emoji picker */
.rte-emoji-picker {
    position: absolute;
    top: 36px; left: 0;
    background: #1a2332;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px;
    z-index: 200;
    width: 270px;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.rte-emoji-item {
    background: none; border: none;
    font-size: 19px; cursor: pointer;
    padding: 3px; border-radius: 4px;
    transition: transform .1s;
    line-height: 1;
}
.rte-emoji-item:hover { transform: scale(1.3); }

/* ── Global alert rendering ─────────────────────────────────
   Applies wherever RTE content is displayed (reviews, descriptions,
   comments, profile bios, etc.) regardless of wrapper class.
   Uses !important so inline style="background:..." doesn't override.
───────────────────────────────────────────────────────────── */
[data-alert="info"] {
    background: rgba(56,189,248,.12) !important;
    border-left: 3px solid #38bdf8 !important;
    border-radius: 6px;
    padding: 10px 14px !important;
    margin: 8px 0 !important;
    display: block;
    color: inherit;
}
[data-alert="warning"] {
    background: rgba(245,158,11,.12) !important;
    border-left: 3px solid #f59e0b !important;
    border-radius: 6px;
    padding: 10px 14px !important;
    margin: 8px 0 !important;
    display: block;
    color: inherit;
}
[data-alert="danger"] {
    background: rgba(239,68,68,.12) !important;
    border-left: 3px solid #ef4444 !important;
    border-radius: 6px;
    padding: 10px 14px !important;
    margin: 8px 0 !important;
    display: block;
    color: inherit;
}
/* Keep the RTE editor/preview rules for specificity parity */
.rte-editor [data-alert="info"],
.rte-preview [data-alert="info"]    { background:rgba(56,189,248,.10) !important; border-left:3px solid #38bdf8 !important; }
.rte-editor [data-alert="warning"],
.rte-preview [data-alert="warning"] { background:rgba(245,158,11,.10) !important; border-left:3px solid #f59e0b !important; }
.rte-editor [data-alert="danger"],
.rte-preview [data-alert="danger"]  { background:rgba(239,68,68,.10)  !important; border-left:3px solid #ef4444 !important; }

/* Admin panel overrides (lighter borders) */
.admin-panel .rte-toolbar,
.admin-panel .rte-editor {
    --rte-border: rgba(255,255,255,0.15);
}
