/* ===================================
   CRAFT & GADGETS - GLOBAL STYLES
   Premium E-Commerce Design System
   Developer: Alomgir Hossen
   =================================== */

/* ============ CSS CUSTOM PROPERTIES ============ */
:root {
  /* Vibrant Colorful Minimal Palette */
  --color-primary: #8B5CF6;
  --color-primary-light: #A78BFA;
  --color-primary-dark: #7C3AED;
  --color-secondary: #3B82F6;
  --color-accent: #EC4899;

  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;

  /* Vibrant Gradients */
  --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  --gradient-secondary: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
  --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  --gradient-dark: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
  --gradient-glow: radial-gradient(circle at center, rgba(139, 92, 246, 0.2), transparent 70%);

  /* High Texture Dark Theme Colors */
  --color-bg-primary: #050505;
  --color-bg-secondary: #0a0a0a;
  --color-bg-tertiary: #111111;
  --color-bg-elevated: #161616;

  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: #cccccc;
  --color-text-tertiary: #999999;
  --color-text-muted: #666666;

  /* Border & Divider */
  --color-border: rgba(255, 255, 255, 0.15);
  --color-border-hover: rgba(255, 255, 255, 0.3);
  --color-divider: rgba(255, 255, 255, 0.1);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 20px rgba(255, 255, 255, 0.05);
  --shadow-glow-primary: 0 0 30px rgba(255, 255, 255, 0.1);
  --shadow-glow-accent: 0 0 30px rgba(255, 255, 255, 0.1);

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 4rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions - Optimized for speed */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 450ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;

  /* Layout */
  --header-height: 80px;
  --header-height-shrink: 64px;
  --max-width-container: 1400px;
  --max-width-content: 1200px;
  --max-width-text: 800px;
}

/* ============ GOOGLE FONTS ============ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ============ RESET & BASE STYLES ============ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background: linear-gradient(135deg, #0F0A1E 0%, #1a103a 25%, #0F0A1E 50%, #1E1B4B 75%, #0F0A1E 100%);
  background-size: 400% 400%;
  animation: gradientBg 15s ease infinite;
  overflow-x: hidden;
  min-height: 100vh;
}

@keyframes gradientBg {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* Smooth Scroll Container */
.smooth-scroll-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* ============ TYPOGRAPHY ============ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-md);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
}

h2 {
  font-size: var(--font-size-4xl);
}

h3 {
  font-size: var(--font-size-3xl);
}

h4 {
  font-size: var(--font-size-2xl);
}

h5 {
  font-size: var(--font-size-xl);
}

h6 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

strong,
b {
  font-weight: var(--font-weight-bold);
}

em,
i {
  font-style: italic;
}

/* ============ UTILITY CLASSES ============ */
.container {
  width: 100%;
  max-width: var(--max-width-container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-content {
  max-width: var(--max-width-content);
  margin: 0 auto;
}

.container-text {
  max-width: var(--max-width-text);
  margin: 0 auto;
}

.section {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section-sm {
  padding: var(--space-3xl) 0;
}

.section-lg {
  padding: calc(var(--space-4xl) * 1.5) 0;
}

/* Text Utilities */
.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-glow {
  text-shadow: 0 0 20px currentColor;
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

/* Grid Utilities */
.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* Responsive Grid */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-accent {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-glow-accent);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-accent);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
}

.btn-ghost:hover {
  background: var(--color-bg-tertiary);
}

.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-lg);
}

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

/* ============ CARDS ============ */
.card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--color-border-hover);
}

.card-elevated {
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-md);
}

/* ============ FORMS ============ */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px hsla(280, 70%, 55%, 0.1);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  color: var(--color-error);
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
}

/* ============ SCROLL PROGRESS BAR ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-primary);
  z-index: var(--z-fixed);
  transition: width 0.1s linear;
}

/* ============ LOADING STATES ============ */
.loading-skeleton {
  background: linear-gradient(90deg,
      var(--color-bg-secondary) 0%,
      var(--color-bg-tertiary) 50%,
      var(--color-bg-secondary) 100%);
  background-size: 200% 100%;
  animation: shimmer 0.8s infinite;
  border-radius: var(--radius-md);
}

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

  100% {
    background-position: -200% 0;
  }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============ RESPONSIVE UTILITIES ============ */
.hide-mobile {
  display: block;
}

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  :root {
    --font-size-5xl: 2.5rem;
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
    --space-4xl: 3rem;
  }

  .hide-mobile {
    display: none;
  }

  .show-mobile {
    display: block;
  }

  .section {
    padding: var(--space-3xl) 0;
  }
}

/* ============ REDUCED MOTION ============ */
@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;
  }
}

/* ============ ACCESSIBILITY ============ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============ SELECTION ============ */
::selection {
  background: var(--color-primary);
  color: white;
}

::-moz-selection {
  background: var(--color-primary);
  color: white;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ============ MOVING TEXT BANNERS ============ */
.text-banner {
  overflow: hidden;
  padding: var(--space-xl) 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.text-banner-row {
  display: flex;
  white-space: nowrap;
  margin-bottom: var(--space-md);
}

.text-banner-row:last-child {
  margin-bottom: 0;
}

.text-banner-content {
  display: flex;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.text-banner-item {
  font-family: var(--font-heading);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
  padding: 0 var(--space-xl);
  -webkit-text-stroke: 1px var(--color-text-secondary);
  color: transparent;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all var(--transition-base);
}

.text-banner-item:hover {
  color: var(--color-primary);
  -webkit-text-stroke: 1px var(--color-primary);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Feature Transparent Banner */
.transparent-banner {
  background: transparent;
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
}

.transparent-banner-text {
  font-size: var(--font-size-6xl);
  font-weight: var(--font-weight-extrabold);
  text-transform: uppercase;
  text-align: center;
  background: linear-gradient(90deg, #fff, #666, #fff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 3s linear infinite;
  line-height: 1;
}

.animated-border-box {
  position: relative;
  padding: var(--space-xl);
  border: 1px solid transparent;
  background: linear-gradient(var(--color-bg-primary), var(--color-bg-primary)) padding-box,
    linear-gradient(90deg, transparent, #ffffff, transparent) border-box;
  background-size: 200% 100%;
  animation: borderMove 3s linear infinite;
}

@keyframes borderMove {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}