/**
 * Bugloos Interactive Design System
 * Global styles, colors, typography, and utilities for WordPress/Elementor widgets
 */

/* ===== CSS CUSTOM PROPERTIES (DESIGN TOKENS) ===== */
:root {
  /* Base Font Size */
  --font-size: 14px;

  /* Brand Colors */
  --bugloos-primary: #63c3d1; /* Cyan/Teal */
  --bugloos-secondary: #7c6eb0; /* Purple */
  --bugloos-dark: #241e46; /* Dark Blue */

  /* Hero Background Colors */
  --bugloos-bg-start: #0f0b2f; /* Hero gradient start */
  --bugloos-bg-middle: #2d1b69; /* Hero gradient middle */
  --bugloos-bg-end: #4a0e4e; /* Hero gradient end */

  /* Text Colors for Dark Backgrounds */
  --bugloos-text-white: #ffffff;
  --bugloos-text-gray: rgba(255, 255, 255, 0.8);

  /* Neutral Colors */
  --bugloos-white: #ffffff;
  --bugloos-gray-50: #f9fafb;
  --bugloos-gray-100: #f3f4f6;
  --bugloos-gray-200: #e5e7eb;
  --bugloos-gray-300: #d1d5db;
  --bugloos-gray-400: #9ca3af;
  --bugloos-gray-500: #6b7280;
  --bugloos-gray-600: #4b5563;
  --bugloos-gray-700: #374151;
  --bugloos-gray-800: #1f2937;
  --bugloos-gray-900: #111827;

  /* Typography */
  --font-family-primary: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* 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 */
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-5: 1.25rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-10: 2.5rem;
  --spacing-12: 3rem;
  --spacing-16: 4rem;
  --spacing-20: 5rem;
  --spacing-24: 6rem;
  --spacing-32: 8rem;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-spring: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* Layout */
  --max-width-container: 80rem;
  --max-width-content: 75rem;
  --max-width-prose: 60rem;
  --max-width-narrow: 48rem;

  /* Container Variants */
  --container-sm: 24rem;
  --container-md: 28rem;
  --container-lg: 32rem;
  --container-xl: 36rem;
  --container-2xl: 42rem;
  --container-3xl: 48rem;
  --container-4xl: 56rem;
  --container-5xl: 64rem;
  --container-6xl: 72rem;
  --container-7xl: 80rem;

  /* Breakpoints (for reference in JavaScript) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* ===== CSS RESET ===== */
/* Universal reset for all elements */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Remove default spacing and styling for common elements */
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
dl,
dd,
ol,
ul,
figure,
hr,
fieldset,
legend {
  margin: 0;
  padding: 0;
}

/* Remove list styles */
ol,
ul {
  list-style: none;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* Remove default link styling */
a {
  color: inherit;
  text-decoration: none;
}

/* Make images responsive by default */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove default form field styling */
input,
textarea,
select {
  background-color: transparent;
  border: none;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Remove default table styling */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Reset fieldset and legend */
fieldset {
  border: none;
}

legend {
  display: table;
}

/* Remove default quotation marks */
blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: "";
  content: none;
}

/* ===== BASE STYLES ===== */

html {
  font-family: var(--font-family-primary);
  font-size: var(--font-size);
  line-height: var(--leading-normal);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-normal);
  color: var(--bugloos-gray-800);
  background-color: var(--bugloos-white);
  line-height: var(--leading-normal);
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY UTILITIES ===== */
.text-xs {
  font-size: var(--text-xs);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-base {
  font-size: var(--text-base);
}
.text-lg {
  font-size: var(--text-lg);
}
.text-xl {
  font-size: var(--text-xl);
}
.text-2xl {
  font-size: var(--text-2xl);
}
.text-3xl {
  font-size: var(--text-3xl);
}
.text-4xl {
  font-size: var(--text-4xl);
}
.text-5xl {
  font-size: var(--text-5xl);
}
.text-6xl {
  font-size: var(--text-6xl);
}

.font-light {
  font-weight: var(--font-weight-light);
}
.font-normal {
  font-weight: var(--font-weight-normal);
}
.font-medium {
  font-weight: var(--font-weight-medium);
}
.font-semibold {
  font-weight: var(--font-weight-semibold);
}
.font-bold {
  font-weight: var(--font-weight-bold);
}
.font-extrabold {
  font-weight: var(--font-weight-extrabold);
}
.font-black {
  font-weight: var(--font-weight-black);
}

/* ===== BUTTON COMPONENT ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-4);
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-normal);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  user-select: none;
  outline: none;
  transform: translateZ(0); /* Force hardware acceleration */
}

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

/* Button Variants */
.btn--primary {
  background-color: var(--bugloos-dark);
  color: var(--bugloos-white);
  border-color: var(--bugloos-dark);
}

.btn--primary:hover {
  background-color: var(--bugloos-primary);
  border-color: var(--bugloos-primary);
  transform: scale(1.05);
}

.btn--secondary {
  background-color: transparent;
  color: var(--bugloos-primary);
  border-color: var(--bugloos-primary);
}

.btn--secondary:hover {
  background-color: var(--bugloos-primary);
  color: var(--bugloos-white);
  transform: scale(1.05);
}

.btn--ghost {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--bugloos-white);
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.btn--ghost:hover {
  background-color: var(--bugloos-primary);
  border-color: var(--bugloos-primary);
  transform: scale(1.05);
}

/* Button Sizes */
.btn--sm {
  padding: var(--spacing-1) var(--spacing-3);
  font-size: var(--text-sm);
}

.btn--lg {
  padding: var(--spacing-3) var(--spacing-6);
  font-size: var(--text-lg);
}

/* ===== UTILITY CLASSES ===== */
.container {
  width: 100%;
  max-width: var(--max-width-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-4);
  padding-right: var(--spacing-4);
}

@media (min-width: 640px) {
  .container {
    padding-left: var(--spacing-6);
    padding-right: var(--spacing-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--spacing-8);
    padding-right: var(--spacing-8);
  }
}

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

/* ===== ANIMATION UTILITIES ===== */
.hover-lift {
  transition: all var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2xl);
}

.btn-hover {
  transition: all var(--transition-normal);
}

.btn-hover:hover {
  transform: scale(1.05);
}

/* Parallax optimizations */
.parallax-element {
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.parallax-smooth {
  transform-origin: center center;
  transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ===== ACCESSIBILITY ===== */
/* Focus States */
.focus-outline:focus {
  outline: 2px solid var(--bugloos-primary);
  outline-offset: 2px;
}

.focus-outline:focus:not(:focus-visible) {
  outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn {
    border-width: 2px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .parallax-element,
  .parallax-smooth,
  .hover-lift,
  .btn-hover,
  .btn,
  * {
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===== RESPONSIVE UTILITIES ===== */
.hidden {
  display: none;
}
.block {
  display: block;
}
.inline {
  display: inline;
}
.inline-block {
  display: inline-block;
}
.flex {
  display: flex;
}
.grid {
  display: grid;
}

@media (min-width: 640px) {
  .sm\:hidden {
    display: none;
  }
  .sm\:block {
    display: block;
  }
  .sm\:flex {
    display: flex;
  }
  .sm\:grid {
    display: grid;
  }
}

@media (min-width: 768px) {
  .md\:hidden {
    display: none;
  }
  .md\:block {
    display: block;
  }
  .md\:flex {
    display: flex;
  }
  .md\:grid {
    display: grid;
  }
}

@media (min-width: 1024px) {
  .lg\:hidden {
    display: none;
  }
  .lg\:block {
    display: block;
  }
  .lg\:flex {
    display: flex;
  }
  .lg\:grid {
    display: grid;
  }
}

@media (min-width: 1280px) {
  .xl\:hidden {
    display: none;
  }
  .xl\:block {
    display: block;
  }
  .xl\:flex {
    display: flex;
  }
  .xl\:grid {
    display: grid;
  }
}

/* ===== Elementor overrides ===== */
.elementor-element {
  gap: 0 !important;
}

.grecaptcha-badge {
  opacity: 0 !important;
  visibility: hidden !important;
}
