/* 
 * Metallura Website - Modern Design System
 * Professional Metals Trading Company
 * Complete Visual Redesign with Modern UI/UX Principles
 */

/* ============================================
   DESIGN TOKENS & CSS CUSTOM PROPERTIES
   ============================================ */

:root {
  /* ===== MODERN COLOR PALETTE ===== */
  /* Primary Colors - Professional Dark Blue with improved contrast */
  --primary-blue: #0f1419;
  --primary-blue-dark: #0a0f14;
  --primary-blue-light: #1a2332;
  --primary-blue-medium: #152028;
  --primary-blue-soft: #243142;
  
  /* Copper & Gold Accents - Enhanced for modern look */
  --copper: #d4822a;
  --copper-light: #e69942;
  --copper-dark: #b86f21;
  --copper-subtle: #f4e4d1;
  --copper-ultra-light: #fdf9f4;
  
  /* Neutral Colors - Improved contrast ratios */
  --white: #ffffff;
  --gray-50: #fafbfc;
  --gray-100: #f4f6f8;
  --gray-200: #e1e7ed;
  --gray-300: #c7d2dd;
  --gray-400: #9da8b6;
  --gray-500: #6c7b8a;
  --gray-600: #556068;
  --gray-700: #3e4954;
  --gray-800: #2a3441;
  --gray-900: #1a2332;
  --black: #000000;
  
  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* Text Colors - WCAG AAA Compliant */
  --text-primary: #1a2332;
  --text-secondary: #556068;
  --text-tertiary: #6c7b8a;
  --text-inverse: #ffffff;
  --text-copper: #d4822a;
  
  /* ===== TYPOGRAPHY SYSTEM ===== */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;
  
  /* Font Sizes - Fluid Typography Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.65rem + 1.125vw, 2.25rem);
  --text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);
  --text-5xl: clamp(3rem, 2.55rem + 2.25vw, 4rem);
  --text-6xl: clamp(4rem, 3.3rem + 3.5vw, 6rem);
  
  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* ===== SPACING SYSTEM ===== */
  --space-px: 1px;
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;
  --space-48: 12rem;
  --space-56: 14rem;
  --space-64: 16rem;
  
  /* Container Sizes */
  --container-xs: 480px;
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* ===== MODERN SHADOWS ===== */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  
  /* Colored Shadows */
  --shadow-copper: 0 10px 15px -3px rgba(212, 130, 42, 0.1), 0 4px 6px -2px rgba(212, 130, 42, 0.05);
  --shadow-blue: 0 10px 15px -3px rgba(15, 20, 25, 0.1), 0 4px 6px -2px rgba(15, 20, 25, 0.05);
  
  /* ===== BORDER RADIUS ===== */
  --radius-none: 0;
  --radius-sm: 0.125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;
  
  /* ===== MODERN TRANSITIONS ===== */
  --transition-none: none;
  --transition-all: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slower: all 500ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Easing Functions */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* ===== GRADIENTS ===== */
  --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-soft) 100%);
  --gradient-copper: linear-gradient(135deg, var(--copper-dark) 0%, var(--copper) 50%, var(--copper-light) 100%);
  --gradient-hero: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-medium) 40%, var(--primary-blue-soft) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  --gradient-card: linear-gradient(145deg, var(--white) 0%, var(--gray-50) 100%);
  
  /* ===== Z-INDEX SCALE ===== */
  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
  
  /* ===== LAYOUT GRID ===== */
  --grid-columns: 12;
  --grid-gap: var(--space-6);
  --grid-gap-sm: var(--space-4);
  --grid-gap-lg: var(--space-8);
}

/* ============================================
   DARK THEME VARIABLES
   ============================================ */

[data-theme="dark"] {
  /* Dark Mode Color Overrides */
  --primary-blue: #1a1f2e;
  --primary-blue-dark: #0f1419;
  --primary-blue-light: #2a3441;
  --primary-blue-medium: #1e2936;
  --primary-blue-soft: #334155;
  
  /* Dark Mode Backgrounds */
  --white: #0f1419;
  --gray-50: #1a1f2e;
  --gray-100: #1e2936;
  --gray-200: #2a3441;
  --gray-300: #334155;
  --gray-400: #475569;
  --gray-500: #64748b;
  --gray-600: #94a3b8;
  --gray-700: #cbd5e1;
  --gray-800: #e2e8f0;
  --gray-900: #f1f5f9;
  
  /* Dark Mode Text */
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-tertiary: #cbd5e1;
  --text-inverse: #0f1419;
  
  /* Dark Mode Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  
  /* Dark Mode Gradients */
  --gradient-card: linear-gradient(145deg, var(--gray-100) 0%, var(--gray-50) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* ============================================
   MODERN RESET & BASE STYLES
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: var(--leading-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--white);
  overflow-x: hidden;
  transition: var(--transition-normal);
}

/* ===== MODERN TYPOGRAPHY ===== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
  color: white;
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-black);
  line-height: var(--leading-none);
  letter-spacing: -0.05em;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.04em;
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.03em;
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-medium);
}

p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

/* Links */
a {
  color: var(--text-copper);
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--copper);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

/* Code */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--gray-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

pre {
  padding: var(--space-4);
  overflow-x: auto;
  white-space: pre-wrap;
}

/* ============================================
   MODERN CONTAINER SYSTEM
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }
.container-2xl { max-width: var(--container-2xl); }

@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }
}

/* ============================================
   MODERN GRID SYSTEM
   ============================================ */

.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-12 { grid-column: span 12 / span 12; }

/* Flex System */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

/* Gaps */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-12 { gap: var(--space-12); }

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-copper { color: var(--text-copper); }
.text-white { color: var(--white); }

/* Background Colors */
.bg-white { background-color: var(--white); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-primary { background-color: var(--primary-blue); }
.bg-copper { background-color: var(--copper); }

/* Spacing */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-8 { margin-top: var(--space-8); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Border Radius */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Transitions */
.transition { transition: var(--transition-normal); }
.transition-fast { transition: var(--transition-fast); }

/* Visibility */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* ============================================
   MODERN ANIMATION SYSTEM
   ============================================ */

/* Fade Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Animation Classes */
.animate-fade-in {
  animation: fadeIn 0.6s var(--ease-out) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s var(--ease-out) forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.8s var(--ease-out) forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s var(--ease-out) forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s var(--ease-out) forwards;
}

.animate-slide-in-up {
  animation: slideInUp 0.8s var(--ease-spring) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.6s var(--ease-spring) forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Stagger Delays */
.delay-75 { animation-delay: 75ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-500 { animation-delay: 500ms; }
.delay-700 { animation-delay: 700ms; }
.delay-1000 { animation-delay: 1000ms; }

/* Intersection Observer Animation System */
.animate-element {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--ease-out);
}

.animate-element.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   MODERN GLASSMORPHISM EFFECTS
   ============================================ */

.glass {
  background: var(--gradient-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
  background: var(--gradient-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   ACCESSIBLE FOCUS STYLES
   ============================================ */

*:focus {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a,
  a:visited {
    text-decoration: underline;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
  }
  
  h2,
  h3 {
    page-break-after: avoid;
  }
  
  img {
    max-width: 100% !important;
  }
}

/* ============================================
   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;
  }
  
  html {
    scroll-behavior: auto;
  }
}
