/* ===== Star delete — כפתור מחיקה במצב עריכת כוכב + חלון האישור (js/star-delete.js) =====
 * הכפתור יושב ב-#edit-mode מתחת ל-Save. בכוונה בלי .glass-button: במובייל
 * ה-glass-button של #info-panel נצבע לבן עם !important, והמחיקה צריכה להישאר אדומה.
 * החלון ברמת body, מעל ה-dock גם כשתפריט שלו פתוח (עד 100200).
 */

#edit-mode .star-delete-btn {
    width: 100%;
    min-height: 46px;
    margin: 10px 0 0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 110, 110, 0.3);
    background: rgba(255, 70, 70, 0.1);
    color: #ffaaaa;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#edit-mode .star-delete-btn:hover {
    background: rgba(255, 70, 70, 0.2);
    border-color: rgba(255, 120, 120, 0.55);
    color: #ffd0d0;
    transform: translateY(-1px);
}

#edit-mode .star-delete-btn:focus-visible {
    outline: 2px solid rgba(255, 140, 140, 0.8);
    outline-offset: 2px;
}

/* #info-panel יושב בתוך #ui-overlay (z-index 10) ולא יכול לעלות מעל ה-dock,
   והבועות כיסו את Save / Delete star. כמו בפאנל המערכת (css/sun-palette.css):
   בזמן מצב העריכה ה-dock מוסתר, כולל הצאצאים (.gd-adopted מכריח visible). */
html.dock-ui body:has(#edit-mode[style*="display: block"]) #galaxy-dock {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease, visibility 0.2s;
}

html.dock-ui body:has(#edit-mode[style*="display: block"]) #galaxy-dock * {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ---------- confirm dialog ---------- */

.star-delete-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(3, 5, 12, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.star-delete-backdrop.is-open {
    opacity: 1;
}

.star-delete-dialog {
    width: min(360px, 100%);
    box-sizing: border-box;
    padding: 24px 22px 20px;
    color: #fff;
    text-align: center;
    background: rgba(9, 13, 24, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.18s ease;
}

.star-delete-backdrop.is-open .star-delete-dialog {
    transform: none;
}

.star-delete-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #ff8a8a;
    background: rgba(255, 70, 70, 0.14);
    border: 1px solid rgba(255, 110, 110, 0.3);
}

.star-delete-dialog h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.star-delete-dialog p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.5;
}

.star-delete-name {
    color: #fff;
    font-weight: 700;
}

.star-delete-dialog .star-delete-error {
    margin-top: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #ffc2c2;
    background: rgba(255, 70, 70, 0.12);
    font-size: 13px;
}

.star-delete-error[hidden] {
    display: none;
}

.star-delete-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.star-delete-actions button {
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.star-delete-actions button:focus-visible {
    outline: 2px solid rgba(120, 205, 255, 0.9);
    outline-offset: 2px;
}

.star-delete-actions button:disabled {
    cursor: default;
    opacity: 0.6;
}

.star-delete-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.star-delete-cancel:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
}

.star-delete-confirm {
    background: rgba(230, 52, 62, 0.82);
    border: 1px solid rgba(255, 130, 130, 0.6);
}

.star-delete-confirm:hover:not(:disabled) {
    background: rgba(242, 64, 74, 0.95);
}

/* ---------- toast ---------- */

.star-delete-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    z-index: 100300;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    padding: 12px 18px;
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    background: rgba(9, 13, 24, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.star-delete-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
    .star-delete-backdrop,
    .star-delete-dialog,
    .star-delete-toast {
        transition: none;
    }
}
