/**
 * Devders Wishlist — Core CSS
 * Shared base styles, resets, variables, utilities, toast, modal, skeleton
 * Variables are injected via wp_add_inline_style from settings
 */

/* ─── Reset & Base ───────────────────────────────────────────────── */
.devders-wl-container * { box-sizing: border-box; margin: 0; padding: 0; }
.devders-wl-container { font-family: var(--dw-font-family, inherit); color: var(--dw-text-main, #222); font-size: var(--dw-font-size, 14px); line-height: 1.5; }
.devders-wl-container img { display: block; max-width: 100%; }
.devders-wl-container button { font-family: inherit; cursor: pointer; }
.devders-wl-container input { font-family: inherit; }
.devders-wl-container select { font-family: inherit; }

/* ─── Utilities ──────────────────────────────────────────────────── */
.devders-wl-hidden { display: none !important; }

/* ─── Animations ─────────────────────────────────────────────────── */
.devders-wl-fade-in { animation: devdersWlFadeIn 0.35s ease forwards; }
@keyframes devdersWlFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.devders-wl-slide-out { animation: devdersWlSlideOut 0.3s ease forwards; max-height: 500px; }
@keyframes devdersWlSlideOut { to { opacity: 0; transform: scale(0.92); max-height: 0; margin-top: 0; margin-bottom: 0; padding: 0; border-width: 0; overflow: hidden; } }

/* ─── Scrollbar ──────────────────────────────────────────────────── */
.devders-wl-container ::-webkit-scrollbar { width: 6px; }
.devders-wl-container ::-webkit-scrollbar-track { background: transparent; }
.devders-wl-container ::-webkit-scrollbar-thumb { background-color: #e0e0e0; border-radius: 20px; }
.devders-wl-container * { scrollbar-width: thin; scrollbar-color: #e0e0e0 transparent; }

/* ─── Checkbox ───────────────────────────────────────────────────── */
.devders-wl-checkbox { appearance: none; width: 18px; height: 18px; border: 2px solid #d0d0d0; border-radius: 4px; cursor: pointer; position: relative; transition: all 0.15s ease; flex-shrink: 0; }
.devders-wl-checkbox:checked { background: var(--dw-primary); border-color: var(--dw-primary); }
.devders-wl-checkbox:checked::after { content: ''; position: absolute; top: 1px; left: 5px; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.devders-wl-checkbox:hover { border-color: var(--dw-primary); }
.devders-wl-checkbox:focus { box-shadow: 0 0 0 2px var(--dw-primary-light); outline: none; }

/* ─── Toast Notifications ────────────────────────────────────────── */
.devders-wl-toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 999999; display: flex; flex-direction: column; gap: 0.5rem; max-width: 20rem; width: 100%; pointer-events: none; }
.devders-wl-toast { pointer-events: auto; background: #fff; border-radius: 0.75rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border: 1px solid var(--dw-border-color, #e8e8e8); padding: 0.75rem; display: flex; align-items: flex-start; gap: 0.625rem; }
.devders-wl-toast-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 0.125rem; }
.devders-wl-toast-text { font-size: 0.875rem; color: var(--dw-text-main); font-weight: 500; line-height: 1.25; flex: 1; }
.devders-wl-toast-undo { margin-left: 0.75rem; font-size: 0.75rem; font-weight: 700; color: var(--dw-primary); background: none; border: none; cursor: pointer; flex-shrink: 0; }
.devders-wl-toast-undo:hover { text-decoration: underline; }
.devders-wl-toast-enter { animation: devdersWlToastIn 0.35s ease forwards; }
@keyframes devdersWlToastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.devders-wl-toast-exit { animation: devdersWlToastOut 0.3s ease forwards; }
@keyframes devdersWlToastOut { to { opacity: 0; transform: translateX(40px); } }

/* ─── Modal ──────────────────────────────────────────────────────── */
.devders-wl-modal-overlay { position: fixed; inset: 0; z-index: 999998; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); }
.devders-wl-modal-overlay.devders-wl-open { display: flex; }
.devders-wl-modal-content { background: #fff; border-radius: 0.75rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); padding: 1.5rem; max-width: 24rem; width: 90%; margin: 0 auto; text-align: center; }
.devders-wl-modal-icon-box { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--dw-primary-light); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.devders-wl-modal-icon-box svg { width: 1.5rem; height: 1.5rem; color: var(--dw-primary); }
.devders-wl-modal-title { font-size: 1.125rem; font-weight: 600; color: var(--dw-text-main); margin-bottom: 0.5rem; }
.devders-wl-modal-desc { font-size: 0.875rem; color: var(--dw-text-sub, #757575); margin-bottom: 1.5rem; }
.devders-wl-modal-actions { display: flex; gap: 0.75rem; }
.devders-wl-modal-btn { flex: 1; padding: 0.625rem 0; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; transition: background 0.2s; outline: none; }
.devders-wl-modal-btn:focus { box-shadow: 0 0 0 2px var(--dw-primary); }
.devders-wl-modal-btn-cancel { border: 1px solid var(--dw-border-color); background: #fff; color: var(--dw-text-sub); }
.devders-wl-modal-btn-cancel:hover { background: #f9fafb; }
.devders-wl-modal-btn-confirm { border: none; background: var(--dw-primary); color: #fff; }
.devders-wl-modal-btn-confirm:hover { background: var(--dw-primary-hover); }

/* ─── Skeleton ───────────────────────────────────────────────────── */
@keyframes devdersWlShimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.devders-wl-skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 800px 100%; animation: devdersWlShimmer 1.5s infinite ease-in-out; border-radius: 4px; }

/* ─── Reduced Motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .devders-wl-container *,
    .devders-wl-container *::before,
    .devders-wl-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
