/* ============================================================
   Shared toast notifications + button spinners
   Included by index.php, add-item.php, settings.php
   ============================================================ */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}

@media (max-width: 480px) {
    #toast-container {
        left: 12px;
        right: 12px;
        max-width: none;
        top: 12px;
    }
}

.app-toast {
    background: #1e293b;
    color: #fff;
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 0.87rem;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0,0,0,0.1);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    line-height: 1.4;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.app-toast-success { background: #059669; }
.app-toast-error   { background: #dc2626; }
.app-toast-warning { background: #d97706; }
.app-toast-info    { background: #1e293b; }

.app-toast-icon {
    font-weight: 800;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-top: 1px;
}

.app-toast-msg { flex-grow: 1; }

/* Inline spinner used inside buttons while an AJAX request is in flight */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.btn-spinner.dark {
    border-color: rgba(15, 23, 42, 0.25);
    border-top-color: #0f172a;
}

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

.is-loading {
    opacity: 0.85;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Small inline spinner overlay for the image upload cells */
.cell-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    z-index: 5;
}

/* Row states while a request is in flight for that row */
tr.row-busy { opacity: 0.55; pointer-events: none; }
tr.row-removing { transition: opacity 0.25s ease, transform 0.25s ease; opacity: 0; transform: translateX(20px); }
