/**
 * Empty-state and skeleton UI styles.
 *
 * Loaded via /includes/footer.php (auto-injected when empty-state partial is used)
 * or directly via @import in main.css.
 *
 * Classes:
 *  .ci-empty-state         - full empty-state card
 *  .ci-skeleton / .ci-skel-* - skeleton loading placeholders
 *  .ci-toast               - toast notifications (replaces inline main.js helper)
 *
 * @author Amit Haridas, ConcreteInfo
 */

/* ── Empty State ─────────────────────────────────────────────────────── */
.ci-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-default);
    border-radius: 12px;
    margin: 1.5rem 0;
}
.ci-empty-state--search { padding: 2rem 1rem; }
.ci-empty-state--error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
}
.ci-empty-state--success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.04);
}
.ci-empty-state__icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--color-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.ci-empty-state--error .ci-empty-state__icon { color: #ef4444; }
.ci-empty-state--success .ci-empty-state__icon { color: #10b981; }
.ci-empty-state__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}
.ci-empty-state__desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 480px;
    line-height: 1.5;
    margin: 0 0 1.25rem 0;
}
.ci-empty-state__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Skeleton Loader ─────────────────────────────────────────────────── */
.ci-skeleton {
    background: linear-gradient(90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%);
    background-size: 200% 100%;
    animation: ciSkelShimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
    color: transparent !important;
}
.ci-skel--text { height: 0.85rem; margin: 0.25rem 0; }
.ci-skel--title { height: 1.25rem; width: 60%; margin-bottom: 0.5rem; }
.ci-skel--avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.ci-skel--card { height: 120px; border-radius: 8px; }
.ci-skel--row { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-subtle); }
.ci-skel--row:last-child { border-bottom: none; }
.ci-skel--block { display: block; }
@keyframes ciSkelShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .ci-skeleton { animation: none; background: var(--bg-secondary); }
}

/* ── Toast (used by assets/js/toast.js) ──────────────────────────────── */
.ci-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 380px;
    pointer-events: none;
}
.ci-toast {
    pointer-events: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-left: 3px solid var(--color-brand);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    min-width: 260px;
    animation: ciToastIn 0.22s ease-out;
    transition: opacity 0.18s, transform 0.18s;
}
.ci-toast--exiting {
    opacity: 0;
    transform: translateX(20px);
}
.ci-toast__icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(229, 70, 31, 0.1);
    color: var(--color-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-top: 0.1rem;
}
.ci-toast--success { border-left-color: #10b981; }
.ci-toast--success .ci-toast__icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.ci-toast--warning { border-left-color: #f59e0b; }
.ci-toast--warning .ci-toast__icon { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.ci-toast--danger { border-left-color: #ef4444; }
.ci-toast--danger .ci-toast__icon { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.ci-toast--info { border-left-color: #3b82f6; }
.ci-toast--info .ci-toast__icon { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.ci-toast__body { flex: 1; }
.ci-toast__title {
    font-weight: 600;
    margin-bottom: 0.15rem;
    color: var(--text-primary);
}
.ci-toast__message {
    color: var(--text-secondary);
    line-height: 1.45;
    font-size: 0.8rem;
}
.ci-toast__close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
    margin-left: 0.25rem;
    transition: color 0.12s;
}
.ci-toast__close:hover { color: var(--text-primary); }
@keyframes ciToastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
    .ci-toast { animation: none; }
}

/* ── Improved Empty Table Placeholder (used inline in tables) ──────── */
.ci-table-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-tertiary);
}
.ci-table-empty i { font-size: 1.75rem; opacity: 0.5; display: block; margin-bottom: 0.5rem; }
.ci-table-empty__title { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.25rem; }
.ci-table-empty__hint { font-size: 0.8rem; }
/* ── Chart Empty State ──────────────────────────────────────────────── */
/* Injected by /assets/js/chart-empty-state.js when an ApexCharts series
   is empty — bare axis frames read as a broken chart otherwise. */
.ci-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    min-height: 120px;
    padding: 1.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.ci-chart-empty i {
    font-size: 1.5rem;
    opacity: 0.5;
    color: var(--text-secondary);
}
