/* ── KEYFRAMES ──────────────────────────────────────────────────*/
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes pulse-glow { 0%,100% { transform:scale(1); opacity:0.5; } 50% { transform:scale(1.1); opacity:1; } }
@keyframes shimmer { 0% { background-position:-1000px 0; } 100% { background-position:1000px 0; } }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideInRight { from { transform:translateX(100%); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes slideOutRight { from { transform:translateX(0); opacity:1; } to { transform:translateX(100%); opacity:0; } }
@keyframes float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }

/* ── SKELETON LOADING ───────────────────────────────────────────*/
.skeleton { background:linear-gradient(90deg, var(--bg-elevated) 0%, var(--border-bright) 50%, var(--bg-elevated) 100%);
  background-size:1000px 100%; animation:shimmer 1.5s infinite; border-radius:var(--radius-sm); }
.skeleton-text { height:14px; border-radius:4px; margin-bottom:8px; }
.skeleton-text.wide { width:80%; }
.skeleton-text.medium { width:55%; }
.skeleton-text.narrow { width:30%; }
.skeleton-title { height:22px; width:60%; border-radius:4px; margin-bottom:12px; }
.skeleton-card { height:120px; border-radius:var(--radius-lg); }
.skeleton-row { height:50px; border-radius:4px; margin-bottom:4px; }
.skeleton-avatar { width:32px; height:32px; border-radius:50%; flex-shrink:0; }
.skeleton-stat { display:flex; flex-direction:column; gap:10px; padding:24px;
  background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius-lg); }

/* ── FADE IN ────────────────────────────────────────────────────*/
.fade-in { animation:fadeIn 300ms ease forwards; }
.stagger-1 { animation-delay:50ms; opacity:0; }
.stagger-2 { animation-delay:100ms; opacity:0; }
.stagger-3 { animation-delay:150ms; opacity:0; }
.stagger-4 { animation-delay:200ms; opacity:0; }

/* ── SPINNER ────────────────────────────────────────────────────*/
.spinner { width:20px; height:20px; border:2px solid var(--border-bright);
  border-top-color:var(--accent-green); border-radius:50%; animation:spin 0.7s linear infinite; }
.spinner-lg { width:36px; height:36px; border-width:3px; }

/* ── TOAST NOTIFICATIONS ────────────────────────────────────────*/
#toast-container { position:fixed; bottom:24px; right:24px; display:flex;
  flex-direction:column; gap:10px; z-index:9999; pointer-events:none; }
.toast { display:flex; align-items:center; gap:12px; padding:14px 18px;
  background:var(--bg-elevated); border:1px solid var(--border-bright); border-radius:var(--radius-md);
  box-shadow:var(--shadow-lg); min-width:280px; max-width:380px; pointer-events:all;
  animation:slideInRight 300ms ease; }
.toast.hiding { animation:slideOutRight 300ms ease forwards; }
.toast svg { width:18px; height:18px; flex-shrink:0; }
.toast-content { flex:1; font-size:0.875rem; line-height:1.4; }
.toast-title { font-weight:600; margin-bottom:2px; }
.toast.success { border-left:3px solid var(--accent-green); }
.toast.success svg { color:var(--accent-green); }
.toast.error { border-left:3px solid var(--danger); }
.toast.error svg { color:var(--danger); }
.toast.info { border-left:3px solid var(--info); }
.toast.info svg { color:var(--info); }
.toast.warning { border-left:3px solid var(--warning); }
.toast.warning svg { color:var(--warning); }

/* ── PAYMENT STATUS MODAL ───────────────────────────────────────*/
.payment-status { display:flex; flex-direction:column; align-items:center; gap:12px;
  padding:24px; text-align:center; }
.payment-status .payment-icon { width:64px; height:64px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; }
.payment-status .payment-icon.pending { background:var(--warning-dim); color:var(--warning); }
.payment-status .payment-icon.success { background:var(--accent-green-dim); color:var(--accent-green); }
.payment-status .payment-icon.failed { background:var(--danger-dim); color:var(--danger); }
.payment-status .payment-icon svg { width:32px; height:32px; }
.payment-status h3 { font-family:var(--font-display); font-size:1.2rem; font-weight:700; }
.payment-status p { color:var(--text-muted); font-size:0.9rem; max-width:280px; }

/* ── PRICE CALCULATOR ───────────────────────────────────────────*/
.price-display { background:var(--bg-elevated); border:1px solid var(--accent-green);
  border-radius:var(--radius-md); padding:16px; display:flex; align-items:center; justify-content:space-between; }
.price-display .price-label { font-size:0.85rem; color:var(--text-muted); }
.price-display .price-value { font-family:var(--font-display); font-size:1.4rem; font-weight:800; color:var(--accent-green); }

/* ── PROGRESS BAR ───────────────────────────────────────────────*/
.progress-bar { height:6px; background:var(--bg-elevated); border-radius:999px; overflow:hidden; }
.progress-fill { height:100%; background:var(--accent-green); border-radius:999px; transition:width 500ms ease; }

/* ── REDUCED MOTION ─────────────────────────────────────────────*/
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
}
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── AI COPILOT STYLING ────────────────────────────────────────── */
.ai-copilot-trigger {
  position: fixed;
  bottom: 24px;
  right: 90px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  z-index: 1000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-primary);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.35);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  animation: float 4s ease-in-out infinite, orb-pulse 3s infinite;
}
.ai-copilot-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.55);
}
.ai-copilot-trigger svg { width: 24px; height: 24px; color: #fff; }

.ai-copilot-chat {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 340px;
  height: 480px;
  display: flex;
  flex-direction: column;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(168, 85, 247, 0.1);
  z-index: 999;
  transform: translateY(15px);
  opacity: 0;
  pointer-events: none;
  transition: all 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-copilot-chat.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.ai-copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.01);
}
.ai-copilot-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.ai-copilot-title svg { color: #a855f7; animation: spin 4s linear infinite; }
.ai-copilot-close {
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}
.ai-copilot-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.ai-copilot-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.ai-copilot-messages::-webkit-scrollbar { width: 4px; }
.ai-copilot-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }

.ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.5;
  animation: fadeIn 200ms ease forwards;
}
.ai-msg.system {
  align-self: flex-start;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  border-top-left-radius: 2px;
}
.ai-msg.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-top-right-radius: 2px;
}

.ai-copilot-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
}
.ai-copilot-pill {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ai-copilot-pill:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.25);
  color: #fff;
}
.ai-copilot-pill svg { width: 12px; height: 12px; color: var(--text-muted); }
.ai-copilot-pill:hover svg { color: var(--purple); }

.ai-copilot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.ai-copilot-input {
  flex: 1;
  min-height: 38px !important;
  height: 38px;
  padding: 6px 12px;
  font-size: 0.82rem;
}
.ai-copilot-send {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.ai-copilot-send:hover {
  transform: scale(1.04);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.ai-typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 10px;
}
.ai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a855f7;
  opacity: 0.4;
  animation: ai-bounce 0.8s infinite alternate;
}
.ai-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-bounce {
  to { transform: translateY(-4px); opacity: 1; }
}

@keyframes orb-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(168, 85, 247, 0.4), 0 0 30px rgba(244, 63, 94, 0.2); }
  50% { box-shadow: 0 0 25px rgba(168, 85, 247, 0.7), 0 0 50px rgba(244, 63, 94, 0.4); }
}
