/* Bless.Top Premium Visual Design System */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Premium Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&family=Source+Code+Pro:wght@400;500&display=swap');

/* CSS Custom Properties */
:root {
  /* Spiritual Color Palette */
  --divine-purple: #8b5cf6;
  --mystic-indigo: #6366f1;
  --ethereal-blue: #3b82f6;
  --celestial-teal: #06b6d4;
  --sacred-emerald: #10b981;
  --enlightened-amber: #f59e0b;
  --cosmic-rose: #ec4899;
  
  /* Gradient Collections */
  --gradient-divine: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-mystic: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  --gradient-aurora: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --gradient-cosmic: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
  --gradient-celestial: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --gradient-ethereal: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Premium Shadows */
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.15);
  --shadow-divine: 0 25px 80px rgba(139, 92, 246, 0.3);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  
  /* Spacing System */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;
}

/* Base Layer - Foundation */
@layer base {
  * {
    @apply box-border;
  }
  
  html {
    @apply scroll-smooth;
    scroll-behavior: smooth;
  }
  
  body {
    @apply bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-50 text-gray-900 antialiased;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    letter-spacing: -0.01em;
    background-attachment: fixed;
    background-image: 
      radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
      radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.04) 0%, transparent 50%);
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    @apply font-semibold tracking-tight text-balance;
  }
  
  p {
    @apply text-balance;
  }
  
  /* Selection Colors */
  ::selection {
    @apply bg-purple-200 text-purple-900;
  }
  
  ::-moz-selection {
    @apply bg-purple-200 text-purple-900;
  }
}

/* Components Layer - Reusable UI Elements */
@layer components {
  /* Layout Components */
  .bless-container {
    @apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12;
  }
  
  .bless-section {
    @apply py-16 md:py-24 lg:py-32;
  }
  
  /* Hero Section */
  .hero-divine {
    @apply min-h-screen flex items-center justify-center relative overflow-hidden;
    background: var(--gradient-divine);
    position: relative;
  }
  
  .hero-divine::before {
    content: '';
    @apply absolute inset-0 opacity-30;
    background-image: 
      radial-gradient(circle at 25% 25%, white 1px, transparent 1px),
      radial-gradient(circle at 75% 75%, rgba(255,255,255,0.5) 1px, transparent 1px);
    background-size: 60px 60px, 40px 40px;
    animation: float 20s ease-in-out infinite;
  }
  
  .hero-content {
    @apply relative z-10 text-center text-white px-4;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  .hero-title {
    @apply text-4xl md:text-6xl lg:text-7xl xl:text-8xl font-bold mb-6 leading-[0.9];
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
  }
  
  .hero-subtitle {
    @apply text-lg md:text-xl lg:text-2xl mb-8 text-white/90 max-w-4xl mx-auto leading-relaxed;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
  
  /* Wish Form - Premium Design */
  .wish-form-container {
    @apply max-w-3xl mx-auto relative;
  }
  
  .wish-form {
    @apply relative p-8 md:p-12;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    box-shadow: 
      var(--shadow-strong),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
  
  .wish-form::before {
    content: '';
    @apply absolute inset-0 rounded-2xl opacity-5 pointer-events-none;
    background: var(--gradient-aurora);
  }
  
  .wish-form::after {
    content: '';
    @apply absolute -inset-0.5 rounded-3xl opacity-0 transition-opacity duration-500;
    background: var(--gradient-mystic);
    z-index: -1;
  }
  
  .wish-form:hover::after {
    @apply opacity-20;
  }
  
  .wish-input {
    @apply w-full p-6 md:p-8 border-2 border-gray-200 text-lg leading-relaxed transition-all duration-500 resize-none;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    min-height: 160px;
    font-family: 'Inter', sans-serif;
  }
  
  .wish-input:focus {
    @apply border-purple-400 outline-none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
      0 0 0 4px rgba(139, 92, 246, 0.1),
      0 20px 40px rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
  }
  
  .wish-input::placeholder {
    @apply text-gray-500 italic leading-relaxed;
  }
  
  /* Spirit Card - Luxury Design */
  .spirit-card {
    @apply relative overflow-hidden cursor-pointer;
    background: 
      linear-gradient(145deg, #ffffff 0%, #fafbff 50%, #f1f5f9 100%);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    box-shadow: 
      var(--shadow-medium),
      0 0 0 1px rgba(255, 255, 255, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
  }
  
  .spirit-card::before {
    content: '';
    @apply absolute inset-0 rounded-2xl opacity-0 transition-all duration-700;
    background: var(--gradient-cosmic);
    z-index: 0;
  }
  
  .spirit-card-content {
    @apply relative z-10;
  }
  
  .spirit-card:hover {
    transform: translateY(-12px) rotateX(5deg) scale(1.02);
    box-shadow: 
      var(--shadow-divine),
      0 0 60px rgba(139, 92, 246, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
  
  .spirit-card:hover::before {
    @apply opacity-10;
  }
  
  .spirit-card:hover .card-shine {
    opacity: 1;
    transform: translateX(100%);
  }
  
  .card-shine {
    @apply absolute inset-y-0 -left-full w-full opacity-0 pointer-events-none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
  }
  
  /* Card Rarity Styles */
  .card-common {
    border: 2px solid #e5e7eb;
  }
  
  .card-rare {
    border: 2px solid #3b82f6;
    background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 100%);
  }
  
  .card-epic {
    border: 2px solid #8b5cf6;
    background: linear-gradient(145deg, #e9d5ff 0%, #f3e8ff 100%);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
  }
  
  .card-legendary {
    border: 2px solid #f59e0b;
    background: linear-gradient(145deg, #fef3c7 0%, #fffbeb 100%);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
  }
  
  /* Button System */
  .btn {
    @apply inline-flex items-center justify-center px-8 py-4 font-semibold transition-all duration-300 cursor-pointer select-none;
    @apply rounded-full border-2 focus:outline-none focus:ring-4 focus:ring-opacity-30;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
  }
  
  .btn::before {
    content: '';
    @apply absolute inset-0 opacity-0 transition-opacity duration-300;
    background: rgba(255, 255, 255, 0.1);
  }
  
  .btn:hover::before {
    @apply opacity-100;
  }
  
  .btn-primary {
    background: var(--gradient-divine);
    @apply text-white border-transparent focus:ring-purple-500;
    box-shadow: 
      0 4px 15px rgba(139, 92, 246, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  
  .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 
      0 8px 25px rgba(139, 92, 246, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  
  .btn-secondary {
    @apply bg-white text-gray-800 border-gray-200 focus:ring-gray-500;
    box-shadow: var(--shadow-soft);
  }
  
  .btn-secondary:hover {
    @apply bg-gray-50 border-gray-300;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
  }
  
  .btn-ghost {
    @apply bg-transparent text-gray-700 border-gray-300 focus:ring-gray-500;
  }
  
  .btn-ghost:hover {
    @apply bg-gray-100 text-gray-900;
    transform: translateY(-1px);
  }
  
  /* Premium Badge System */
  .premium-badge {
    @apply inline-flex items-center px-4 py-2 rounded-full text-sm font-semibold;
    background: var(--gradient-celestial);
    @apply text-orange-800 shadow-md;
    position: relative;
    overflow: hidden;
  }
  
  .premium-badge::before {
    content: '✨';
    @apply mr-2;
  }
  
  .limited-badge {
    @apply inline-flex items-center px-4 py-2 rounded-full text-sm font-semibold;
    background: var(--gradient-cosmic);
    @apply text-pink-800 shadow-md;
    animation: pulse-glow 2s ease-in-out infinite;
  }
  
  .limited-badge::before {
    content: '🔥';
    @apply mr-2;
  }
  
  /* Navigation */
  .nav-container {
    @apply fixed top-0 w-full z-50 transition-all duration-500;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .nav-scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-medium);
  }
  
  .nav-logo {
    @apply text-2xl font-bold;
    background: var(--gradient-mystic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  /* Loading States */
  .loading-spinner {
    @apply w-6 h-6 border-2 border-white/30 border-t-white rounded-full;
    animation: spin 1s linear infinite;
  }
  
  .skeleton {
    @apply animate-pulse;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s ease-in-out infinite;
  }
  
  /* Payment UI */
  .payment-card {
    @apply relative p-8 bg-white rounded-2xl border-2 transition-all duration-300;
    box-shadow: var(--shadow-medium);
  }
  
  .payment-card:hover {
    @apply border-purple-300;
    box-shadow: var(--shadow-strong);
    transform: translateY(-4px);
  }
  
  .payment-card.selected {
    @apply border-purple-500 bg-purple-50;
    box-shadow: 
      var(--shadow-divine),
      0 0 0 4px rgba(139, 92, 246, 0.1);
  }
  
  /* QR Code Container */
  .qr-container {
    @apply relative p-8 bg-white rounded-2xl shadow-lg;
    background: 
      radial-gradient(circle at center, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  }
  
  /* Footer */
  .footer-divine {
    background: var(--gradient-divine);
    @apply text-white relative overflow-hidden;
  }
  
  .footer-divine::before {
    content: '';
    @apply absolute inset-0 opacity-10;
    background-image: 
      radial-gradient(circle at 25% 25%, white 2px, transparent 2px),
      radial-gradient(circle at 75% 75%, rgba(255,255,255,0.5) 1px, transparent 1px);
    background-size: 80px 80px, 40px 40px;
  }
}

/* Utilities Layer - Helper Classes */
@layer utilities {
  .text-balance {
    text-wrap: balance;
  }
  
  .gradient-text {
    background: var(--gradient-mystic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .hover-lift {
    transition: transform 0.3s ease;
  }
  
  .hover-lift:hover {
    transform: translateY(-4px);
  }
  
  .hover-glow:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
  }
  
  .text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  
  .text-shadow-md {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  .text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
}

/* Animations */
@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
  }
  50% { 
    transform: translateY(-20px) rotate(5deg); 
  }
}

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

@keyframes skeleton-wave {
  0% { 
    background-position: -200px 0; 
  }
  100% { 
    background-position: 200px 0; 
  }
}

@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3); 
  }
  50% { 
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.6); 
  }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    @apply text-3xl md:text-4xl;
    line-height: 1.1;
  }
  
  .wish-form {
    @apply p-6 mx-4;
  }
  
  .spirit-card {
    @apply p-6;
  }
  
  .btn {
    @apply px-6 py-3 text-sm;
  }
}

@media (max-width: 640px) {
  .bless-container {
    @apply px-4;
  }
  
  .hero-subtitle {
    @apply text-base;
  }
  
  .wish-input {
    @apply p-4 text-base;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --gradient-divine: linear-gradient(135deg, #4c1d95 0%, #581c87 100%);
  }
  
  body {
    @apply bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 text-white;
  }
  
  .wish-form {
    background: rgba(15, 23, 42, 0.95);
    @apply text-white border-slate-700;
  }
  
  .wish-input {
    background: rgba(30, 41, 59, 0.8);
    @apply text-white border-slate-600 placeholder-gray-400;
  }
  
  .spirit-card {
    background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
    @apply text-white border-slate-700;
  }
  
  .nav-container {
    background: rgba(15, 23, 42, 0.95);
  }
}

/* Print Styles */
@media print {
  .nav-container,
  .btn,
  .floating-elements {
    @apply hidden;
  }
  
  .spirit-card {
    @apply shadow-none border-2 border-gray-400;
    page-break-inside: avoid;
  }
  
  body {
    @apply text-black bg-white;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .wish-form,
  .spirit-card {
    @apply border-4 border-black;
  }
  
  .btn-primary {
    @apply bg-black text-white border-black;
  }
  
  .gradient-text {
    @apply text-black;
    background: none;
    -webkit-text-fill-color: unset;
  }
}

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