/* Toolkit Cache Manager — toast + admin bar helpers */

.ovkit-toast-container {
    position: fixed;
    z-index: 100000;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ovkit-toast {
    position: relative;
    pointer-events: auto;
    background: #1f2937;
    color: #f9fafb;
    border-radius: 10px;
    padding: 12px 36px 12px 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    font-size: 13px;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ovkit-toast.is-visible  { opacity: 1; transform: translateY(0) scale(1); }
.ovkit-toast.is-leaving  { opacity: 0; transform: translateY(8px) scale(0.98); }

.ovkit-toast__title      { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.ovkit-toast__subtitle   { font-size: 11px; opacity: 0.75; margin-bottom: 4px; }

.ovkit-toast__list       { list-style: none; margin: 6px 0 0; padding: 0; }
.ovkit-toast__item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
    color: #e5e7eb;
}
.ovkit-toast__item-text  { flex: 1 1 auto; word-break: break-word; }

.ovkit-toast__note {
    margin-top: 8px;
    padding: 6px 8px;
    font-size: 11px;
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.06);
    border-left: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

/* Status badges */
.ovkit-badge {
    flex: 0 0 auto;
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.3;
    white-space: nowrap;
}
.ovkit-badge.is-ok   { background: rgba(52, 211, 153, 0.2);  color: #6ee7b7; }
.ovkit-badge.is-warn { background: rgba(251, 191, 36, 0.2);  color: #fcd34d; }
.ovkit-badge.is-fail { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
.ovkit-badge.is-mute { background: rgba(156, 163, 175, 0.2); color: #d1d5db; }

.ovkit-toast__actions { margin-top: 8px; display: flex; gap: 6px; }
.ovkit-toast__btn {
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px 10px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
}
.ovkit-toast__btn:hover { background: rgba(255, 255, 255, 0.2); }

.ovkit-toast__close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0.6;
}
.ovkit-toast__close:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }

/* Level variants */
.ovkit-toast--success { background: #14532d; }
.ovkit-toast--success .ovkit-toast__title { color: #d1fae5; }

.ovkit-toast--warn { background: #78350f; }
.ovkit-toast--warn .ovkit-toast__title { color: #fde68a; }

.ovkit-toast--error { background: #7f1d1d; }
.ovkit-toast--error .ovkit-toast__title { color: #fecaca; }

.ovkit-toast--working { background: #1e3a8a; }
.ovkit-toast--working .ovkit-toast__title { color: #dbeafe; }
.ovkit-toast--working .ovkit-toast__title::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -1px;
    animation: ovkit-toast-spin 0.8s linear infinite;
}
.ovkit-toast--info { background: #1f2937; }

@keyframes ovkit-toast-spin { to { transform: rotate(360deg); } }

/* Admin bar hints */
#wpadminbar #wp-admin-bar-ovkit-cache-hint > .ab-item,
#wpadminbar #wp-admin-bar-ovkit-cache-detected > .ab-item {
    color: #a7a7a7 !important;
    cursor: default;
}

#wpadminbar .ovkit-cache-action > .ab-item {
    cursor: pointer;
}

/* Aggressive items get a subtle amber indicator */
#wpadminbar .ovkit-cache-aggressive > .ab-item::before {
    content: "\26A0";
    color: #fbbf24;
    margin-right: 6px;
    opacity: 0.9;
}

@media (max-width: 600px) {
    .ovkit-toast-container {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: none;
    }
}
