/* SkillWala - Animations & Premium Effects */

/* Logo — clean edge + soft glow (no spin) */
.logo-mark {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12), 0 2px 10px rgba(28, 25, 23, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover .logo-mark {
  transform: scale(1.04);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25), 0 4px 16px rgba(28, 25, 23, 0.08);
}

[data-theme="dark"] .logo-mark {
  box-shadow: 0 0 0 1px rgba(106, 176, 255, 0.28), 0 2px 12px rgba(0, 0, 0, 0.35);
  animation: logo-soft-glow 4s ease-in-out infinite;
}

[data-theme="dark"] .logo:hover .logo-mark {
  box-shadow: 0 0 0 1px rgba(127, 255, 204, 0.45), 0 4px 16px rgba(106, 176, 255, 0.2);
}

@keyframes logo-soft-glow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(106, 176, 255, 0.28), 0 2px 12px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(127, 255, 204, 0.38), 0 2px 14px rgba(106, 176, 255, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-mark { animation: none; }
}

/* SkillWaala brand text — gradient flow */
@keyframes brand-waala-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes brand-skill-shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-skill,
  .logo-waala {
    animation: none;
  }
}

/* Animated mesh background layer */
#page-bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background: transparent;
}

[data-theme="dark"] .bg-aurora {
  background: transparent;
}

.bg-aurora::before,
.bg-aurora::after {
  display: none;
}

#page-bg-canvas {
  opacity: 0;
  visibility: hidden;
}

[data-theme="dark"] #page-bg-canvas {
  opacity: 0;
  visibility: hidden;
}

[data-theme="light"] .ai-chat-panel {
  background: rgba(255, 255, 255, 0.97);
  border-color: var(--border);
}

[data-theme="light"] .ai-robot-btn {
  background: linear-gradient(145deg, #fff, #f0f2f8);
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .card-preview {
  background: linear-gradient(135deg, #2d3748 0%, #1a365d 50%, #2c5282 100%);
}

[data-theme="light"] .payment-success-overlay {
  background: rgba(244, 246, 250, 0.95);
}

.bg-mesh-grid,
.bg-spotlight,
.bg-vignette,
.floating-orbs {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes aurora-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 8%) scale(1.1); }
}

/* Floating orbs */
.floating-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.floating-orbs span {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(13, 148, 136, 0.04));
  border: 1px solid rgba(28, 25, 23, 0.04);
  animation: float-orb 20s ease-in-out infinite;
}

[data-theme="dark"] .floating-orbs span {
  background: linear-gradient(135deg, rgba(106, 176, 255, 0.08), rgba(127, 255, 204, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.floating-orbs span:nth-child(1) { width: 300px; height: 300px; top: 10%; left: 5%; animation-duration: 22s; }
.floating-orbs span:nth-child(2) { width: 200px; height: 200px; top: 60%; right: 8%; animation-duration: 18s; animation-delay: -5s; }
.floating-orbs span:nth-child(3) { width: 150px; height: 150px; bottom: 15%; left: 30%; animation-duration: 25s; animation-delay: -10s; }
.floating-orbs span:nth-child(4) { width: 120px; height: 120px; top: 30%; right: 25%; animation-duration: 16s; animation-delay: -3s; }
.floating-orbs span:nth-child(5) { width: 180px; height: 180px; top: 75%; left: 55%; animation-duration: 21s; animation-delay: -7s; opacity: 0.7; }

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -40px) rotate(5deg); }
  66% { transform: translate(-20px, 25px) rotate(-3deg); }
}

/* Scroll reveal */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }

/* Enhanced cards */
.category-card,
.worker-card,
.stat-card,
.step-card,
.form-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.35s;
}

.category-card:hover,
.worker-card:hover {
  box-shadow: 0 8px 40px rgba(106, 176, 255, 0.12), 0 0 0 1px rgba(106, 176, 255, 0.15);
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%);
  animation: shimmer 4s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(25deg); }
  100% { transform: translateX(100%) rotate(25deg); }
}

/* Hero enhancements */
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-badge {
  animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(106, 176, 255, 0.2); }
  50% { box-shadow: 0 0 20px 4px rgba(106, 176, 255, 0.15); }
}

.search-bar {
  animation: search-glow 3s ease-in-out infinite;
}

@keyframes search-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(127, 255, 204, 0); }
  50% { box-shadow: 0 0 30px rgba(127, 255, 204, 0.08); }
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::after {
  left: 100%;
}

/* Navbar — always light */
.navbar.scrolled {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* ========== AI ROBOT ASSISTANT ========== */
.ai-robot-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 2500;
  font-family: var(--font);
}

.ai-robot-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(106, 176, 255, 0.4);
  background: linear-gradient(145deg, #1a1a28, #12121a);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(106, 176, 255, 0.25), 0 0 0 0 rgba(106, 176, 255, 0.4);
  animation: robot-float 3s ease-in-out infinite, robot-ring 2s ease-in-out infinite;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.ai-robot-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(127, 255, 204, 0.3);
}

@keyframes robot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes robot-ring {
  0%, 100% { box-shadow: 0 8px 32px rgba(106, 176, 255, 0.25), 0 0 0 0 rgba(106, 176, 255, 0.3); }
  50% { box-shadow: 0 8px 32px rgba(106, 176, 255, 0.25), 0 0 0 12px rgba(106, 176, 255, 0); }
}

.ai-robot-btn:hover { animation: none; transform: scale(1.08); }

.ai-robot-svg {
  width: 40px;
  height: 40px;
}

.ai-robot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--accent-green);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  animation: badge-blink 2s infinite;
}

@keyframes badge-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ai-chat-panel {
  position: absolute;
  bottom: 80px;
  left: 0;
  width: 340px;
  max-height: 460px;
  background: rgba(20, 20, 28, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(106, 176, 255, 0.25);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(106, 176, 255, 0.08);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chat-slide-up 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-chat-panel.open {
  display: flex;
}

@keyframes chat-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(106, 176, 255, 0.15), rgba(127, 255, 204, 0.1));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-chat-header-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.ai-chat-header h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.ai-chat-header p {
  font-size: 0.75rem;
  color: var(--accent-green);
}

.ai-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
}

.ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: msg-pop 0.3s ease;
}

@keyframes msg-pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.ai-msg.bot {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.ai-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(106, 176, 255, 0.2), rgba(127, 255, 204, 0.15));
  border: 1px solid rgba(106, 176, 255, 0.3);
  border-bottom-right-radius: 4px;
}

.ai-chat-quick {
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border);
}

.ai-quick-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.ai-quick-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(106, 176, 255, 0.08);
}

.ai-chat-input-wrap {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.ai-chat-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.ai-chat-input:focus {
  border-color: var(--accent-blue);
}

.ai-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  color: var(--bg-primary);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.ai-chat-send:hover { transform: scale(1.1); }

.ai-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
}

.ai-typing span {
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
  animation: typing-dot 1.2s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* ========== PAYMENT PAGE PREMIUM ========== */
.payment-page {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  position: relative;
}

.payment-header {
  text-align: center;
  margin-bottom: 40px;
}

.payment-header h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff, var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.payment-header p {
  color: var(--text-secondary);
}

.payment-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.payment-main {
  animation: fade-in-up 0.6s ease;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Animated credit card */
.card-preview-wrap {
  perspective: 1000px;
  margin-bottom: 28px;
}

.card-preview {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1.586;
  border-radius: 16px;
  padding: 24px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 1px solid rgba(106, 176, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(106, 176, 255, 0.1);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  animation: card-float 4s ease-in-out infinite;
}

.card-preview.flipped {
  transform: rotateY(180deg);
}

@keyframes card-float {
  0%, 100% { transform: rotateX(2deg) rotateY(-2deg); }
  50% { transform: rotateX(-2deg) rotateY(2deg); }
}

.card-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.06) 45%, transparent 50%);
  animation: card-shine 3s infinite;
}

@keyframes card-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.card-chip {
  width: 44px;
  height: 32px;
  background: linear-gradient(135deg, #ffd27d, #c4a035);
  border-radius: 6px;
  margin-bottom: 24px;
}

.card-number-display {
  font-family: 'Courier New', monospace;
  font-size: 1.3rem;
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-details-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-holder-display {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-holder-display strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-top: 4px;
}

.card-expiry-display {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
}

.card-expiry-display strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-top: 4px;
}

.card-brand {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 1.5rem;
  font-weight: 800;
  font-style: italic;
  opacity: 0.8;
}

.payment-method {
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.payment-method.selected {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(106, 176, 255, 0.2);
}

.payment-form-panel {
  animation: panel-slide 0.4s ease;
}

@keyframes panel-slide {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.secure-badges {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(125, 255, 179, 0.06);
  border: 1px solid rgba(125, 255, 179, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.secure-badges span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.order-summary {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  animation: fade-in-up 0.6s ease 0.2s both;
  border: 1px solid rgba(106, 176, 255, 0.2);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.order-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  border-radius: var(--radius) var(--radius) 0 0;
}

.summary-row.total span:last-child {
  color: var(--accent-green);
  font-size: 1.3rem;
}

.btn-pay {
  background: linear-gradient(135deg, var(--accent-blue), #4a90d9);
  position: relative;
  overflow: hidden;
}

.btn-pay:hover {
  background: linear-gradient(135deg, #5a9fff, var(--accent-blue));
}

.btn-pay.processing {
  pointer-events: none;
  opacity: 0.8;
}

.btn-pay.processing::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  right: 20px;
  top: 50%;
  margin-top: -10px;
}

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

/* Payment success overlay */
.payment-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(12px);
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: overlay-in 0.4s ease;
}

.payment-success-overlay.visible {
  display: flex;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.success-checkmark {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(125, 255, 179, 0.2), rgba(106, 176, 255, 0.2));
  border: 3px solid var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 24px;
  animation: success-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes success-pop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.payment-success-overlay h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.payment-success-overlay p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.payment-success-overlay .amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-green);
  margin: 16px 0 24px;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall 3s ease-in forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@media (max-width: 768px) {
  .payment-layout { grid-template-columns: 1fr; }
  .ai-chat-panel { width: calc(100vw - 48px); left: 0; }
  .ai-robot-widget { left: 16px; bottom: 16px; }
  .card-preview { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
