/* ═══════════════════════════════════════════════════════════════════════
   image-editor.css — محرّرُ الصورة قبل الرفع (js/shared/image-editor.js)
   ═══════════════════════════════════════════════════════════════════════
   يُحمَّل في لوحة الفندق ولوحة المنصّة. كلُّ القواعد `zie-*` ولا تعتمد على
   متغيّرات صفحةٍ بعينها: الألوانُ هنا صريحة فيُرسم المحرّرُ نفسُه في السطحين. */

.zie-overlay {
    position: fixed; inset: 0; z-index: 12000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(3, 9, 13, 0.72);
}
.zie-panel {
    box-sizing: border-box;
    width: min(680px, 100%);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px 16px 14px;
    border-radius: 18px;
    border: 1px solid rgba(112, 234, 200, 0.22);
    background: #0c171d;
    color: #e8f3ef;
    font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.zie-panel *, .zie-panel *::before, .zie-panel *::after { box-sizing: border-box; }
.zie-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.zie-title { margin: 0; font-size: 16px; font-weight: 800; }
.zie-hint { margin: 0; font-size: 12.5px; line-height: 1.6; color: rgba(232, 243, 239, 0.62); }
.zie-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.zie-stage {
    display: flex; align-items: center; justify-content: center;
    min-height: 180px;
    padding: 10px;
    border-radius: 14px;
    /* 🏁 رقعةُ شطرنج خلف الإطار — الشفافيّةُ تُرى شفّافة لا سوداء. */
    background-color: #0a1216;
    background-image:
        linear-gradient(45deg, #121e24 25%, transparent 25%), linear-gradient(-45deg, #121e24 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #121e24 75%), linear-gradient(-45deg, transparent 75%, #121e24 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.zie-canvas {
    display: block; max-width: 100%;
    border-radius: 10px;
    outline: 2px solid rgba(112, 234, 200, 0.85);
    outline-offset: 0;
    cursor: grab; touch-action: none;
    box-shadow: 0 0 0 9999px rgba(3, 9, 13, 0.28);
}
.zie-canvas:active { cursor: grabbing; }
.zie-canvas:focus-visible { outline: 3px solid #8fe3c1; }

.zie-tools { display: flex; flex-direction: column; gap: 10px; }
.zie-zoom { display: flex; align-items: center; gap: 10px; }
.zie-range { flex: 1; min-width: 0; accent-color: #5ec9a0; height: 28px; }
.zie-iconbtn {
    flex: none; display: inline-grid; place-items: center;
    width: 40px; height: 40px; padding: 0;
    border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04); color: inherit; cursor: pointer;
}
.zie-iconbtn:hover { border-color: rgba(112, 234, 200, 0.5); }
.zie-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.zie-tool {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 0 12px;
    border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04); color: inherit;
    font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.zie-tool:hover { border-color: rgba(112, 234, 200, 0.5); color: #b2ffe3; }
.zie-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.zie-chips[hidden] { display: none; }
.zie-chips-l { font-size: 12px; font-weight: 700; color: rgba(232, 243, 239, 0.6); margin-inline-end: 4px; }
.zie-chip {
    min-height: 36px; padding: 0 14px;
    border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent; color: inherit; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.zie-chip[aria-pressed="true"] { background: rgba(94, 201, 160, 0.18); border-color: rgba(112, 234, 200, 0.6); color: #b2ffe3; }
.zie-swatch {
    width: 32px; height: 32px; padding: 0;
    border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); cursor: pointer;
}
.zie-swatch.is-transparent {
    background-color: #fff;
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}
.zie-swatch[aria-pressed="true"] { border-color: #5ec9a0; box-shadow: 0 0 0 3px rgba(94, 201, 160, 0.35); }
.zie-status { margin: 0; min-height: 1.2em; font-size: 12.5px; font-weight: 700; color: #fcd28a; }
.zie-status:empty { display: none; }
.zie-foot { display: flex; justify-content: flex-end; gap: 10px; }
.zie-btn {
    min-height: 44px; padding: 0 18px;
    border-radius: 12px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.zie-btn:disabled { opacity: .55; cursor: not-allowed; }
.zie-ghost { border: 1px solid rgba(255, 255, 255, 0.18); background: transparent; color: inherit; }
.zie-primary { border: 0; background: #5ec9a0; color: #06231a; }
.zie-primary:hover:not(:disabled) { background: #74d6b0; }
@media (max-width: 520px) {
    .zie-overlay { padding: 0; align-items: flex-end; }
    .zie-panel { border-radius: 18px 18px 0 0; max-height: 100dvh; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
    .zie-foot .zie-btn { flex: 1; }
    .zie-tool span { font-size: 12px; }
}
