/* PayFlow Pro - Advanced Design System v2.0 */
/* Modern UI/UX with Glassmorphism, Animations, and Enhanced Interactions */

/* ==========================================
   DESIGN TOKENS & SYSTEM VARIABLES
   ========================================== */

:root {
  /* Enhanced Color Palette */
  --pf-black: #000000;
  --pf-black-90: #0a0a0a;
  --pf-black-80: #1a1a1a;
  --pf-black-70: #262626;
  --pf-black-60: #333333;
  --pf-black-50: #404040;
  
  --pf-white: #ffffff;
  --pf-white-90: #f5f5f5;
  --pf-white-80: #e8e8e8;
  --pf-white-70: #d4d4d4;
  --pf-white-60: #a3a3a3;
  --pf-white-50: #737373;
  
  /* Primary Brand Colors */
  --pf-gold: #FFD700;
  --pf-gold-90: #e6c200;
  --pf-gold-80: #ccad00;
  --pf-gold-70: #b39900;
  --pf-gold-60: #998400;
  --pf-gold-50: #806f00;
  
  --pf-amber: #E8742A;
  --pf-amber-90: #d16825;
  --pf-amber-80: #ba5d20;
  --pf-amber-70: #a3521b;
  --pf-amber-60: #8c4616;
  --pf-amber-50: #753b11;
  
  --pf-salmon: #D4856F;
  --pf-salmon-90: #bf7963;
  --pf-salmon-80: #aa6e57;
  --pf-salmon-70: #95624b;
  --pf-salmon-60: #80563f;
  --pf-salmon-50: #6b4b33;
  
  /* Semantic Colors */
  --pf-success: #10B981;
  --pf-success-light: rgba(16, 185, 129, 0.1);
  --pf-success-border: rgba(16, 185, 129, 0.2);
  
  --pf-warning: #F59E0B;
  --pf-warning-light: rgba(245, 158, 11, 0.1);
  --pf-warning-border: rgba(245, 158, 11, 0.2);
  
  --pf-error: #EF4444;
  --pf-error-light: rgba(239, 68, 68, 0.1);
  --pf-error-border: rgba(239, 68, 68, 0.2);
  
  --pf-info: #3B82F6;
  --pf-info-light: rgba(59, 130, 246, 0.1);
  --pf-info-border: rgba(59, 130, 246, 0.2);
  
  /* Surface & Elevation */
  --pf-surface-0: rgba(0, 0, 0, 1);
  --pf-surface-1: rgba(10, 10, 10, 1);
  --pf-surface-2: rgba(20, 20, 20, 1);
  --pf-surface-3: rgba(30, 30, 30, 1);
  --pf-surface-4: rgba(40, 40, 40, 1);
  
  --pf-glass-1: rgba(255, 255, 255, 0.02);
  --pf-glass-2: rgba(255, 255, 255, 0.04);
  --pf-glass-3: rgba(255, 255, 255, 0.06);
  --pf-glass-4: rgba(255, 255, 255, 0.08);
  --pf-glass-5: rgba(255, 255, 255, 0.10);
  
  /* Typography Scale */
  --pf-font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
  --pf-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --pf-font-serif: 'Crimson Text', 'Georgia', 'Times New Roman', serif;
  
  --pf-text-xs: 0.75rem;    /* 12px */
  --pf-text-sm: 0.875rem;   /* 14px */
  --pf-text-base: 1rem;     /* 16px */
  --pf-text-lg: 1.125rem;   /* 18px */
  --pf-text-xl: 1.25rem;    /* 20px */
  --pf-text-2xl: 1.5rem;    /* 24px */
  --pf-text-3xl: 1.875rem;  /* 30px */
  --pf-text-4xl: 2.25rem;   /* 36px */
  --pf-text-5xl: 3rem;      /* 48px */
  --pf-text-6xl: 3.75rem;   /* 60px */
  --pf-text-7xl: 4.5rem;    /* 72px */
  
  /* Spacing Scale (based on 4px) */
  --pf-space-0: 0;
  --pf-space-1: 0.25rem;    /* 4px */
  --pf-space-2: 0.5rem;     /* 8px */
  --pf-space-3: 0.75rem;    /* 12px */
  --pf-space-4: 1rem;       /* 16px */
  --pf-space-5: 1.25rem;    /* 20px */
  --pf-space-6: 1.5rem;     /* 24px */
  --pf-space-8: 2rem;       /* 32px */
  --pf-space-10: 2.5rem;    /* 40px */
  --pf-space-12: 3rem;      /* 48px */
  --pf-space-16: 4rem;      /* 64px */
  --pf-space-20: 5rem;      /* 80px */
  --pf-space-24: 6rem;      /* 96px */
  --pf-space-32: 8rem;      /* 128px */
  
  /* Border Radius Scale */
  --pf-radius-none: 0;
  --pf-radius-sm: 0.125rem;   /* 2px */
  --pf-radius-base: 0.25rem;  /* 4px */
  --pf-radius-md: 0.375rem;   /* 6px */
  --pf-radius-lg: 0.5rem;     /* 8px */
  --pf-radius-xl: 0.75rem;    /* 12px */
  --pf-radius-2xl: 1rem;      /* 16px */
  --pf-radius-3xl: 1.5rem;    /* 24px */
  --pf-radius-full: 9999px;
  
  /* Shadow System */
  --pf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --pf-shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --pf-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --pf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --pf-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --pf-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --pf-shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  
  --pf-shadow-glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
  --pf-shadow-glow-amber: 0 0 20px rgba(232, 116, 42, 0.3);
  --pf-shadow-glow-success: 0 0 20px rgba(16, 185, 129, 0.3);
  
  /* Animation Timings */
  --pf-duration-fast: 150ms;
  --pf-duration-base: 200ms;
  --pf-duration-slow: 300ms;
  --pf-duration-slower: 500ms;
  
  --pf-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --pf-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --pf-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --pf-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Z-Index Scale */
  --pf-z-0: 0;
  --pf-z-10: 10;
  --pf-z-20: 20;
  --pf-z-30: 30;
  --pf-z-40: 40;
  --pf-z-50: 50;
  --pf-z-dropdown: 100;
  --pf-z-sticky: 200;
  --pf-z-fixed: 300;
  --pf-z-modal: 1000;
  --pf-z-toast: 2000;
  --pf-z-tooltip: 3000;
}

/* ==========================================
   ENHANCED GLASSMORPHISM COMPONENTS
   ========================================== */

.pf-glass {
  background: var(--pf-glass-2);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--pf-duration-base) var(--pf-ease-out);
}

.pf-glass:hover {
  background: var(--pf-glass-3);
  border-color: rgba(255, 215, 0, 0.2);
  box-shadow: var(--pf-shadow-lg), var(--pf-shadow-glow-gold);
}

.pf-glass-strong {
  background: var(--pf-glass-4);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.pf-glass-subtle {
  background: var(--pf-glass-1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================
   ADVANCED BUTTON SYSTEM
   ========================================== */

.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pf-space-2);
  font-family: var(--pf-font-sans);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--pf-radius-lg);
  cursor: pointer;
  transition: all var(--pf-duration-base) var(--pf-ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  
  /* Focus styles */
  &:focus-visible {
    outline: 2px solid var(--pf-gold);
    outline-offset: 2px;
  }
  
  /* Disabled state */
  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
  }
}

/* Button Sizes */
.pf-btn-xs {
  padding: var(--pf-space-1) var(--pf-space-3);
  font-size: var(--pf-text-xs);
  min-height: 1.75rem;
}

.pf-btn-sm {
  padding: var(--pf-space-2) var(--pf-space-4);
  font-size: var(--pf-text-sm);
  min-height: 2.25rem;
}

.pf-btn-base {
  padding: var(--pf-space-3) var(--pf-space-6);
  font-size: var(--pf-text-base);
  min-height: 2.75rem;
}

.pf-btn-lg {
  padding: var(--pf-space-4) var(--pf-space-8);
  font-size: var(--pf-text-lg);
  min-height: 3.25rem;
}

.pf-btn-xl {
  padding: var(--pf-space-5) var(--pf-space-10);
  font-size: var(--pf-text-xl);
  min-height: 3.75rem;
}

/* Button Variants */
.pf-btn-primary {
  background: linear-gradient(135deg, var(--pf-gold), var(--pf-amber));
  color: var(--pf-black);
  box-shadow: var(--pf-shadow-base);
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--pf-duration-slow) var(--pf-ease-out);
  }
  
  &:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--pf-shadow-xl), var(--pf-shadow-glow-gold);
    
    &::before {
      left: 100%;
    }
  }
  
  &:active {
    transform: translateY(-1px) scale(1.01);
  }
}

.pf-btn-secondary {
  background: var(--pf-glass-2);
  color: var(--pf-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  
  &:hover {
    background: var(--pf-glass-3);
    border-color: var(--pf-gold);
    color: var(--pf-gold);
    transform: translateY(-1px);
    box-shadow: var(--pf-shadow-md);
  }
}

.pf-btn-outline {
  background: transparent;
  color: var(--pf-white);
  border: 2px solid var(--pf-gold);
  
  &:hover {
    background: var(--pf-gold);
    color: var(--pf-black);
    transform: translateY(-1px);
    box-shadow: var(--pf-shadow-glow-gold);
  }
}

.pf-btn-ghost {
  background: transparent;
  color: var(--pf-white-70);
  border: 1px solid transparent;
  
  &:hover {
    background: var(--pf-glass-2);
    color: var(--pf-white);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* ==========================================
   ENHANCED FORM COMPONENTS
   ========================================== */

.pf-form-group {
  margin-bottom: var(--pf-space-6);
}

.pf-label {
  display: block;
  font-family: var(--pf-font-sans);
  font-size: var(--pf-text-sm);
  font-weight: 600;
  color: var(--pf-white);
  margin-bottom: var(--pf-space-2);
  
  .pf-label-required {
    color: var(--pf-error);
    margin-left: var(--pf-space-1);
  }
}

.pf-input {
  width: 100%;
  background: var(--pf-glass-1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--pf-radius-lg);
  padding: var(--pf-space-4) var(--pf-space-5);
  font-family: var(--pf-font-sans);
  font-size: var(--pf-text-base);
  color: var(--pf-white);
  transition: all var(--pf-duration-base) var(--pf-ease-out);
  backdrop-filter: blur(8px);
  
  &::placeholder {
    color: var(--pf-white-50);
  }
  
  &:focus {
    outline: none;
    background: var(--pf-glass-2);
    border-color: var(--pf-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
  }
  
  &:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  &.pf-input-error {
    border-color: var(--pf-error);
    box-shadow: 0 0 0 3px var(--pf-error-light);
  }
  
  &.pf-input-success {
    border-color: var(--pf-success);
    box-shadow: 0 0 0 3px var(--pf-success-light);
  }
}

.pf-textarea {
  @extend .pf-input;
  resize: vertical;
  min-height: 120px;
}

.pf-select {
  @extend .pf-input;
  cursor: pointer;
  
  option {
    background: var(--pf-surface-2);
    color: var(--pf-white);
  }
}

/* ==========================================
   ADVANCED CARD SYSTEM
   ========================================== */

.pf-card {
  background: var(--pf-glass-1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--pf-radius-2xl);
  padding: var(--pf-space-8);
  backdrop-filter: blur(12px);
  transition: all var(--pf-duration-base) var(--pf-ease-out);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pf-gold), var(--pf-amber));
    opacity: 0;
    transition: opacity var(--pf-duration-base) var(--pf-ease-out);
  }
  
  &:hover {
    background: var(--pf-glass-2);
    border-color: rgba(255, 215, 0, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--pf-shadow-xl), var(--pf-shadow-glow-gold);
    
    &::before {
      opacity: 1;
    }
  }
}

.pf-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--pf-space-6);
}

.pf-card-title {
  font-family: var(--pf-font-sans);
  font-size: var(--pf-text-2xl);
  font-weight: 700;
  color: var(--pf-white);
  line-height: 1.2;
}

.pf-card-subtitle {
  font-family: var(--pf-font-sans);
  font-size: var(--pf-text-sm);
  font-weight: 500;
  color: var(--pf-amber);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: var(--pf-space-1);
}

.pf-card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--pf-gold), var(--pf-amber));
  border-radius: var(--pf-radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--pf-text-2xl);
  color: var(--pf-black);
  flex-shrink: 0;
  box-shadow: var(--pf-shadow-md);
}

.pf-card-content {
  color: var(--pf-white-70);
  line-height: 1.6;
  margin-bottom: var(--pf-space-6);
}

.pf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* ==========================================
   PREMIUM ANIMATIONS & MICRO-INTERACTIONS
   ========================================== */

@keyframes pf-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pf-fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pf-slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pf-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes pf-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

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

@keyframes pf-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Animation Utility Classes */
.pf-animate-fade-in-up {
  animation: pf-fadeInUp var(--pf-duration-slow) var(--pf-ease-out) both;
}

.pf-animate-fade-in-scale {
  animation: pf-fadeInScale var(--pf-duration-base) var(--pf-ease-out) both;
}

.pf-animate-slide-in-right {
  animation: pf-slideInRight var(--pf-duration-base) var(--pf-ease-out) both;
}

.pf-animate-bounce {
  animation: pf-bounce 1s ease-in-out infinite;
}

.pf-animate-pulse {
  animation: pf-pulse 2s ease-in-out infinite;
}

.pf-animate-spin {
  animation: pf-spin 1s linear infinite;
}

/* Staggered Animations */
.pf-stagger-1 { animation-delay: 0.1s; }
.pf-stagger-2 { animation-delay: 0.2s; }
.pf-stagger-3 { animation-delay: 0.3s; }
.pf-stagger-4 { animation-delay: 0.4s; }
.pf-stagger-5 { animation-delay: 0.5s; }
.pf-stagger-6 { animation-delay: 0.6s; }

/* ==========================================
   ENHANCED LOADING STATES
   ========================================== */

.pf-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pf-space-3);
  color: var(--pf-white-60);
  font-size: var(--pf-text-sm);
}

.pf-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-top: 2px solid var(--pf-gold);
  border-radius: 50%;
  animation: pf-spin 1s linear infinite;
}

.pf-skeleton {
  background: linear-gradient(
    90deg,
    var(--pf-glass-1) 25%,
    var(--pf-glass-2) 50%,
    var(--pf-glass-1) 75%
  );
  background-size: 200% 100%;
  animation: pf-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--pf-radius-base);
}

/* ==========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================== */

/* Focus Management */
.pf-focus-visible:focus-visible {
  outline: 2px solid var(--pf-gold);
  outline-offset: 2px;
  border-radius: var(--pf-radius-base);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --pf-white: #ffffff;
    --pf-black: #000000;
    --pf-gold: #ffff00;
    --pf-amber: #ff8000;
  }
}

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

/* ==========================================
   RESPONSIVE UTILITIES
   ========================================== */

/* Breakpoint Variables */
@custom-media --pf-sm (min-width: 640px);
@custom-media --pf-md (min-width: 768px);
@custom-media --pf-lg (min-width: 1024px);
@custom-media --pf-xl (min-width: 1280px);
@custom-media --pf-2xl (min-width: 1536px);

/* Mobile-First Responsive Classes */
@media (max-width: 767px) {
  .pf-mobile-hidden { display: none; }
  .pf-mobile-full { width: 100%; }
  .pf-mobile-center { text-align: center; }
}

@media (min-width: 768px) {
  .pf-desktop-hidden { display: none; }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
  .pf-no-print { display: none !important; }
  
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
}

/* ==========================================
   DARK MODE ENHANCEMENTS
   ========================================== */

@media (prefers-color-scheme: light) {
  .pf-auto-dark {
    /* Light mode overrides could go here */
    /* Currently maintaining dark theme by design */
  }
}

/* ==========================================
   COMPONENT STATES
   ========================================== */

.pf-state-loading {
  cursor: progress;
  opacity: 0.7;
  pointer-events: none;
}

.pf-state-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.pf-state-success {
  border-color: var(--pf-success) !important;
  box-shadow: 0 0 0 3px var(--pf-success-light) !important;
}

.pf-state-error {
  border-color: var(--pf-error) !important;
  box-shadow: 0 0 0 3px var(--pf-error-light) !important;
}

.pf-state-warning {
  border-color: var(--pf-warning) !important;
  box-shadow: 0 0 0 3px var(--pf-warning-light) !important;
}