/**
 * Gradia POS — Licensing UI
 * Status pills, Pro padlock overlays, and the nested notification stack
 * used by Settings -> Authentication and any Pro-gated feature elsewhere
 * in the plugin (admin screens and the POS terminal itself).
 */

/* ── Status pill ─────────────────────────────────────────────────────── */
.gradia-pos-lic-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 13px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.gradia-pos-lic-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.gradia-pos-lic-pill-active { background: rgba(16,185,129,.12); color: #059669; }
.gradia-pos-lic-pill-active .gradia-pos-lic-pill-dot { background: #10b981; animation: gradia-pos-lic-pulse 1.6s ease-in-out infinite; }

.gradia-pos-lic-pill-warn { background: rgba(245,158,11,.14); color: #b45309; }
.gradia-pos-lic-pill-warn .gradia-pos-lic-pill-dot { background: #f59e0b; }

.gradia-pos-lic-pill-error { background: rgba(239,68,68,.12); color: #dc2626; }
.gradia-pos-lic-pill-error .gradia-pos-lic-pill-dot { background: #ef4444; }

.gradia-pos-lic-pill-neutral { background: rgba(156,163,175,.14); color: #6b7280; }
.gradia-pos-lic-pill-neutral .gradia-pos-lic-pill-dot { background: #9ca3af; }

@keyframes gradia-pos-lic-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Pro padlock badge (inline, for labels/menu items) ──────────────── */
.gradia-pos-pro-lock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pc9-gradient, linear-gradient(135deg, #1e90ff 0%, #000 100%));
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
    vertical-align: middle;
}
.gradia-pos-pro-lock svg { flex-shrink: 0; }

/* ── Pro overlay (wraps a full feature block) ────────────────────────── */
.gradia-pos-pro-wrap { position: relative; }
.gradia-pos-pro-wrap-locked > *:not(.gradia-pos-pro-overlay) {
    filter: blur(2.5px);
    opacity: .45;
    pointer-events: none;
    user-select: none;
}
.gradia-pos-pro-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,.55);
    backdrop-filter: blur(1px);
    border-radius: inherit;
}
body.gradia-pos-dark .gradia-pos-pro-overlay,
.gradia-pos-page .gradia-pos-pro-overlay {
    background: rgba(0,0,0,.35);
}
.gradia-pos-pro-overlay-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pc9-gradient, linear-gradient(135deg, #1e90ff 0%, #000 100%));
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.gradia-pos-pro-overlay-text {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}
body.gradia-pos-dark .gradia-pos-pro-overlay-text { color: #f1f5f9; }
.gradia-pos-pro-overlay-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--pc9-accent, #1e90ff);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.gradia-pos-pro-overlay-link:hover { text-decoration: underline; }

/* ── Nested notification stack (toasts) ──────────────────────────────── */
#gradia-pos-lic-toast-stack {
    position: fixed;
    top: 40px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
    pointer-events: none;
}
.gradia-pos-lic-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    border: 1px solid rgba(0,0,0,.06);
    font-size: 12.5px;
    color: #1f2937;
    animation: gradia-pos-lic-toast-in .22s ease-out;
}
.gradia-pos-lic-toast.gradia-pos-lic-toast-leaving {
    animation: gradia-pos-lic-toast-out .18s ease-in forwards;
}
@keyframes gradia-pos-lic-toast-in {
    from { transform: translateX(16px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes gradia-pos-lic-toast-out {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(16px); opacity: 0; }
}
.gradia-pos-lic-toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 12px;
}
.gradia-pos-lic-toast-success .gradia-pos-lic-toast-icon { background: #10b981; }
.gradia-pos-lic-toast-error   .gradia-pos-lic-toast-icon { background: #ef4444; }
.gradia-pos-lic-toast-warning .gradia-pos-lic-toast-icon { background: #f59e0b; }
.gradia-pos-lic-toast-info    .gradia-pos-lic-toast-icon { background: #1e90ff; }
.gradia-pos-lic-toast-body { flex: 1; line-height: 1.5; }
.gradia-pos-lic-toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.gradia-pos-lic-toast-close:hover { color: #374151; }

/* ── Nested activity list (persisted history inside the tab) ────────── */
.gradia-pos-lic-events {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 260px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #eef0f3;
}
.gradia-pos-lic-event {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
}
.gradia-pos-lic-event:last-child { border-bottom: none; }
.gradia-pos-lic-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}
.gradia-pos-lic-event-connected     .gradia-pos-lic-event-dot { background: #10b981; }
.gradia-pos-lic-event-disconnected  .gradia-pos-lic-event-dot { background: #9ca3af; }
.gradia-pos-lic-event-status_changed .gradia-pos-lic-event-dot { background: #1e90ff; }
.gradia-pos-lic-event-blocked       .gradia-pos-lic-event-dot { background: #ef4444; }
.gradia-pos-lic-event-warning       .gradia-pos-lic-event-dot { background: #f59e0b; }
.gradia-pos-lic-event-error         .gradia-pos-lic-event-dot { background: #ef4444; }
.gradia-pos-lic-event-body { flex: 1; color: #374151; line-height: 1.5; }
.gradia-pos-lic-event-time { display: block; color: #9ca3af; font-size: 10.5px; margin-top: 2px; }
.gradia-pos-lic-events-empty { padding: 22px 14px; text-align: center; color: #9ca3af; font-size: 12px; }
