/* Paylaşılan bileşen stilleri (Skeleton*, LoadingSpinner, ToastContainer).
   Önceden her bileşen kendi global <style> bloğunu basıyordu; aynı kurallar
   render sırasına göre birbirini eziyordu. Scoped CSS (Admin.styles.css)
   index.html'e bağlı olmadığı için tek global dosya. */

/* Ortak animasyonlar — drawer.css de fadeIn'i buradan kullanıyor */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── Skeleton ─────────────────────────────────────────── */
/* Renkler custom.css'teki --wte-skeleton-* değişkenlerinde (açık: gri, koyu: beyaz örtü). */
.skeleton-box {
    background: linear-gradient(90deg,
        var(--wte-skeleton-base) 25%,
        var(--wte-skeleton-highlight) 50%,
        var(--wte-skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* TableSkeleton: tam genişlik yalnız tablo hücrelerinde */
.skeleton-table {
    animation: fadeIn 0.3s ease-in;
}

.skeleton-table .skeleton-box {
    width: 100%;
}

/* ── LoadingSpinner ───────────────────────────────────── */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fadeIn 0.2s ease-in;
}

.spinner-wrapper {
    text-align: center;
    color: white;
}

/* ── LoadingOverlay (bileşen içi örtü; kapsayıcı position: relative) ── */
/* Zemin iki temada da beyaz örtü (önceki inline stil); koyu tema için ayrı değer henüz yok. */
.local-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    z-index: 20;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 80px;
    cursor: wait;
    pointer-events: all;
}

.local-loading-overlay .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

/* ── AiIterationTimeline ─────────────────────────────── */
.ai-timeline-connector {
    width: 2px;
    height: 16px;
    background-color: var(--wte-border);
}

/* ── IngredientEditorTable "satır ekle" düğmesi ──────── */
/* .btn.: .border-top'un !important kenarlık stilini (aynı özgüllükte) güvenle ezsin. */
.btn.btn-add-row {
    border-style: dashed !important;
    padding: 0.75rem;
}

/* ── ToastContainer ───────────────────────────────────── */
.custom-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    width: 340px;
    min-height: 90px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    user-select: none;
    cursor: grab;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.custom-toast:active {
    cursor: grabbing;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.custom-toast-header {
    padding: 12px 16px;
    border-bottom: none;
    align-items: center;
    font-weight: 600;
}

.custom-toast-body {
    padding: 14px 16px;
    font-size: 14px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.toast-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.custom-toast.toast-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.custom-toast.toast-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.custom-toast.toast-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #212529;
}

.custom-toast.toast-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.custom-toast .btn-close {
    opacity: 0.8;
    filter: brightness(0) invert(1);
}

.custom-toast.toast-warning .btn-close {
    filter: none;
}
