/* ═══════════════════════════════════════════════════════════
   ZAPTOU — Splash, Loading & Transitions
   Sistema compartilhado para todo o ecossistema
   ═══════════════════════════════════════════════════════════ */

/* ── Splash Screen ─────────────────────────────────────────── */
.splash-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #FF5C00 0%, #ff8533 50%, #FF5C00 100%);
    transition: opacity .4s ease, visibility .4s ease;
}
.splash-screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo {
    width: 80px; height: 80px; border-radius: 20px;
    background: rgba(255,255,255,.2); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px; animation: splashPulse 1.5s ease-in-out infinite;
}
.splash-logo .material-symbols-outlined { font-size: 40px; color: #fff; }
.splash-title { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 8px; letter-spacing: -.5px; }
.splash-subtitle { font-size: .9rem; color: rgba(255,255,255,.8); margin-bottom: 32px; }
.splash-progress { width: 200px; height: 4px; background: rgba(255,255,255,.2); border-radius: 2px; overflow: hidden; }
.splash-progress-bar { height: 100%; background: #fff; border-radius: 2px; width: 0; transition: width .3s ease; animation: splashProgress 2s ease-in-out forwards; }
.splash-tip { position: absolute; bottom: 40px; font-size: .8rem; color: rgba(255,255,255,.6); }

@keyframes splashPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes splashProgress { 0% { width: 0; } 50% { width: 70%; } 100% { width: 100%; } }

/* ── Page Loading Overlay ──────────────────────────────────── */
.page-loading {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(255,255,255,.85); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.page-loading.active { opacity: 1; visibility: visible; }
.page-loading-spinner {
    width: 48px; height: 48px; border: 3px solid #e5e7eb;
    border-top-color: #FF5C00; border-radius: 50%;
    animation: spin .8s linear infinite;
}
.page-loading-text { margin-top: 12px; font-size: .85rem; color: #6b7280; font-weight: 500; }

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

/* ── Button Loading State ──────────────────────────────────── */
.btn-loading { position: relative; pointer-events: none; opacity: .7; }
.btn-loading::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 20px; height: 20px; margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: spin .6s linear infinite;
}

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    border-radius: 10px; font-size: .88rem; font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    transform: translateX(120%); transition: transform .3s ease;
    max-width: 360px;
}
.toast.show { transform: translateX(0); }
.toast.success { background: #10b981; color: #fff; }
.toast.error { background: #ef4444; color: #fff; }
.toast.info { background: #1a1a2e; color: #fff; }
.toast.warning { background: #f59e0b; color: #fff; }
.toast .material-symbols-outlined { font-size: 20px; }

/* ── Page Transition ───────────────────────────────────────── */
.page-enter { animation: pageSlideIn .3s ease forwards; }
.page-exit { animation: pageSlideOut .2s ease forwards; }

@keyframes pageSlideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pageSlideOut { from { opacity: 1; } to { opacity: 0; } }

/* ── Skeleton Loading ──────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; margin-bottom: 12px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }

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

/* ── Empty State ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: #9ca3af; }
.empty-state .material-symbols-outlined { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: #6b7280; margin-bottom: 4px; }
.empty-state p { font-size: .85rem; }

/* ── Double-Click Prevention ───────────────────────────────── */
[data-disable-dblclick] { cursor: pointer; }
[data-disable-dblclick].processing { pointer-events: none; opacity: .6; }

/* ── Form Field Instructions ───────────────────────────────── */
.field-instruction {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: .78rem; color: #9ca3af; margin-top: 4px; line-height: 1.4;
}
.field-instruction .material-symbols-outlined { font-size: 14px; margin-top: 1px; flex-shrink: 0; }

/* ── Pulse Dot (online indicator) ──────────────────────────── */
.pulse-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #10b981;
    display: inline-block; position: relative;
}
.pulse-dot::after {
    content: ''; position: absolute; inset: -3px; border-radius: 50%;
    background: rgba(16,185,129,.3); animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0; } }

/* ── Confetti (success animation) ──────────────────────────── */
.confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 10001; }
.confetti-piece {
    position: absolute; width: 8px; height: 8px; border-radius: 2px;
    animation: confettiFall 1.5s ease forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
