'use client';

import { useAuthStore } from '@/store/authStore';
import { motion } from 'framer-motion';

export default function PendingPage() {
  const { user } = useAuthStore();

  return (
    <div className="min-h-screen flex items-center justify-center bg-vault-dark relative overflow-hidden">
      <div className="absolute inset-0 overflow-hidden">
        <div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-96 h-96 bg-primary-500/5 rounded-full blur-3xl" />
      </div>

      <motion.div
        initial={{ opacity: 0, y: 20 }}
        animate={{ opacity: 1, y: 0 }}
        transition={{ duration: 0.5 }}
        className="relative text-center max-w-md mx-4"
      >
        <div className="glass p-8 rounded-2xl border border-vault-border/50">
          <div className="w-16 h-16 bg-yellow-500/10 rounded-full flex items-center justify-center mx-auto mb-6">
            <svg className="w-8 h-8 text-yellow-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
            </svg>
          </div>

          <h1 className="text-2xl font-bold mb-2">Pending Approval</h1>
          <p className="text-vault-muted mb-6">
            Hi {user?.displayName || user?.username}, your account is currently pending approval.
            An administrator will review your registration shortly.
          </p>

          <div className="glass-darker p-4 rounded-xl mb-6">
            <div className="flex items-center justify-between mb-3">
              <span className="text-sm text-vault-muted">Status</span>
              <span className="text-sm font-medium text-yellow-500 flex items-center gap-2">
                <span className="w-2 h-2 bg-yellow-500 rounded-full animate-pulse" />
                Pending Approval
              </span>
            </div>
            <div className="flex items-center justify-between">
              <span className="text-sm text-vault-muted">Email</span>
              <span className="text-sm text-vault-text">{user?.email}</span>
            </div>
          </div>

          <p className="text-xs text-vault-muted/50">
            You will be able to access the workspace once an administrator approves your account.
          </p>
        </div>
      </motion.div>
    </div>
  );
}
