/* Rabta — animated empty / instruction illustrations (no background) */

.tw-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.25rem 3rem;
    animation: reb-fade-in 0.6s ease-out both;
}

.tw-empty-state--sm { padding: 1.5rem 1rem 2rem; }
.tw-empty-state--lg { padding: 3rem 1.5rem 3.5rem; min-height: 320px; }

@keyframes reb-fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Illustration canvas ── */
.reb-illus {
    --reb-stroke: #0a75ad;
    --reb-stroke-2: #6366f1;
    --reb-accent: #00e5d4;
    --reb-muted: #94a3b8;
    --reb-glow: rgba(0, 229, 212, 0.45);
    width: 100%;
    max-width: 280px;
    margin: 0 auto 1.25rem;
    position: relative;
}

.reb-illus--sm { max-width: 200px; margin-bottom: 1rem; }
.reb-illus--lg { max-width: 340px; margin-bottom: 1.5rem; }

.reb-illus-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.reb-illus-svg .reb-stroke {
    fill: none;
    stroke: var(--reb-stroke);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reb-illus-svg .reb-stroke-2 {
    fill: none;
    stroke: var(--reb-stroke-2);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reb-illus-svg .reb-accent {
    fill: none;
    stroke: var(--reb-accent);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reb-illus-svg .reb-muted {
    fill: none;
    stroke: var(--reb-muted);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-dasharray: 4 5;
    opacity: 0.7;
}

.reb-illus-svg .reb-fill-accent {
    fill: var(--reb-accent);
    stroke: none;
    opacity: 0.85;
}

.reb-illus-svg .reb-fill-primary {
    fill: var(--reb-stroke);
    stroke: none;
    opacity: 0.2;
}

/* Draw-in animation */
.reb-draw {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: reb-draw 1.8s ease forwards;
}

.reb-draw-delay-1 { animation-delay: 0.2s; }
.reb-draw-delay-2 { animation-delay: 0.45s; }
.reb-draw-delay-3 { animation-delay: 0.7s; }
.reb-draw-delay-4 { animation-delay: 0.95s; }

@keyframes reb-draw {
    to { stroke-dashoffset: 0; }
}

/* Floating elements */
.reb-float {
    animation: reb-float 3.2s ease-in-out infinite;
    transform-origin: center;
}

.reb-float-slow { animation-duration: 4.5s; }
.reb-float-delay { animation-delay: 0.8s; }

@keyframes reb-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Pulse nodes */
.reb-pulse {
    animation: reb-pulse 2.4s ease-in-out infinite;
}

@keyframes reb-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* Orbit ring */
.reb-orbit {
    transform-origin: 140px 120px;
    animation: reb-orbit 12s linear infinite;
}

@keyframes reb-orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scan line */
.reb-scan {
    animation: reb-scan 2.8s ease-in-out infinite;
}

@keyframes reb-scan {
    0%, 100% { transform: translateX(-6px); opacity: 0.6; }
    50% { transform: translateX(6px); opacity: 1; }
}

/* Arrow flow */
.reb-flow {
    stroke-dasharray: 8 6;
    animation: reb-flow 1.2s linear infinite;
}

@keyframes reb-flow {
    to { stroke-dashoffset: -28; }
}

/* Glow behind illustration */
.reb-illus-glow {
    position: absolute;
    inset: 10% 15%;
    background: radial-gradient(ellipse at center, var(--reb-glow) 0%, transparent 70%);
    filter: blur(18px);
    z-index: 0;
    pointer-events: none;
    animation: reb-glow-pulse 4s ease-in-out infinite;
}

@keyframes reb-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.95); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

.reb-illus-svg { position: relative; z-index: 1; }

/* ── Text ── */
.tw-empty-state-text {
    max-width: 520px;
    animation: reb-fade-in 0.7s ease-out 0.25s both;
}

.tw-empty-state-msg {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.4rem);
    font-weight: 700;
    line-height: 1.55;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #0a75ad 0%, #088da5 45%, #00e5d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.tw-empty-state--sm .tw-empty-state-msg {
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
}

.tw-empty-state-sub {
    margin: 0.5rem 0 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--tw-text-muted, #64748b);
    line-height: 1.5;
}

.tw-empty-state-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.85rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--reb-stroke);
    border: 1px solid rgba(10, 117, 173, 0.2);
    background: rgba(10, 117, 173, 0.06);
    animation: reb-float 3s ease-in-out infinite;
}

.tw-empty-state-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--reb-accent);
    animation: reb-pulse 1.5s ease-in-out infinite;
}

/* ── Dark theme ── */
html[data-app-theme="dark"] .reb-illus,
[data-app-theme="dark"] .reb-illus {
    --reb-stroke: #00e5d4;
    --reb-stroke-2: #818cf8;
    --reb-accent: #38bdf8;
    --reb-muted: #475569;
    --reb-glow: rgba(0, 229, 212, 0.25);
}

html[data-app-theme="dark"] .tw-empty-state-msg,
[data-app-theme="dark"] .tw-empty-state-msg {
    background: linear-gradient(135deg, #e2e8f0 0%, #00e5d4 50%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

html[data-app-theme="dark"] .tw-empty-state-sub,
[data-app-theme="dark"] .tw-empty-state-sub {
    color: #94a3b8;
}

html[data-app-theme="dark"] .tw-empty-state-badge,
[data-app-theme="dark"] .tw-empty-state-badge {
    color: #00e5d4;
    border-color: rgba(0, 229, 212, 0.25);
    background: rgba(0, 229, 212, 0.08);
}

.reb-step-num {
    fill: var(--reb-stroke);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
}

.reb-step-num--active { fill: var(--reb-accent); }

/* Legacy img fallback — hide if still present */
img[src*="rabta-no-data"],
img[src*="rabta-empty"],
img[src*="rabta-instruction"],
img[src*="emptysupplyingview"],
img[src*="selectfromlist"] {
    display: none !important;
}
