/* ================================================
   LOVENSE AFFILIATE SITE - GLOBAL STYLES
   Deep Purple Theme with Light/Dark Mode Support
   ================================================ */

/* CSS CUSTOM PROPERTIES - THEME VARIABLES */
:root {
  /* Deep Purple Color Palette */
  --primary-purple: #6B46C1;
  --secondary-purple: #7C3AED;
  --accent-purple: #9333EA;
  --deep-purple: #5B21B6;
  --light-purple: #A78BFA;

  /* Light Mode Colors */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #6B7280;
  --border-color: #E5E7EB;
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Accent & UI Colors */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;

  /* Gradients */
  --gradient-purple: linear-gradient(135deg, var(--primary-purple) 0%, var(--accent-purple) 100%);
  --gradient-hero: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);

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

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* DARK MODE THEME */
[data-theme="dark"] {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-tertiary: #334155;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-tertiary: #94A3B8;
  --border-color: #475569;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* SMOOTH THEME TRANSITIONS */
* {
  transition: background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* TYPOGRAPHY */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

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

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

a:hover {
  color: var(--accent-purple);
}

/* CONTAINER */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
}

/* LAYOUT UTILITIES */
.section {
  padding: var(--spacing-3xl) 0;
}

.section-sm {
  padding: var(--spacing-2xl) 0;
}

.section-lg {
  padding: clamp(4rem, 8vw, 6rem) 0;
}

/* GRID SYSTEM */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* FLEXBOX UTILITIES */
.flex {
  display: flex;
}

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

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

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

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(107, 70, 193, 0.5);
}

.btn-outline {
  background: rgba(107, 70, 193, 0.08);
  color: var(--text-primary);
  /* Use variable for accessibility on light backgrounds */
  border: 2px solid var(--primary-purple);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(107, 70, 193, 0.15);
}

.btn-outline:hover {
  background: var(--primary-purple);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.35);
}

/* Force light text for buttons on dark purple hero backgrounds */
.hero .btn-outline,
.about-hero .btn-outline {
  color: #FFFFFF !important;
}

.btn-lg {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
}

/* CARDS */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: 0 1px 3px var(--shadow-color);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--shadow-color);
}

/* BADGES */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-purple {
  background: rgba(107, 70, 193, 0.1);
  color: var(--primary-purple);
}

/* Badge in hero section - white text for visibility on purple gradient */
.hero .badge-purple {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

/* IMAGES */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-lazy {
  opacity: 0;
  transition: opacity var(--transition-base);
}

.img-lazy.loaded {
  opacity: 1;
}

/* UTILITIES */
.text-center {
  text-align: center;
}

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

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

.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mt-xl {
  margin-top: var(--spacing-xl);
}

.mt-2xl {
  margin-top: var(--spacing-2xl);
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.mb-xl {
  margin-bottom: var(--spacing-xl);
}

.mb-2xl {
  margin-bottom: var(--spacing-2xl);
}

/* 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 STYLES */
*:focus-visible {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

/* RESPONSIVE TYPOGRAPHY */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  /* Responsive button styles */
  .btn {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 1rem 1.5rem;
    white-space: normal;
    text-align: center;
  }

  .btn-lg {
    padding: 1.25rem 1.75rem;
    font-size: 1.125rem;
  }

  .btn-sm {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* PRINT STYLES */
@media print {
  * {
    background: white !important;
    color: black !important;
  }
}