/**
 * Base Styles - Shared Design Tokens & Utilities
 * Speed Protection - Astra Child Theme
 * 
 * This file contains:
 * - CSS Custom Properties (Design Tokens)
 * - Global Resets
 * - Utility Classes
 * - Shared Animations
 * - Common Component Styles
 */

/* =========================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================= */
:root {
  /* Primary Colors */
  --sp-primary: #ff4d00;
  --sp-primary-dark: #cc3d00;
  --sp-accent: #ff8800;

  /* Neutral Colors */
  --sp-dark: #0a0a0a;
  --sp-darker: #000000;
  --sp-light: #f8fafc;
  --sp-grey-bg: #e9ecef;
  --sp-white: #ffffff;

  /* Text Colors */
  --sp-text: #1a1a1a;
  --sp-text-muted: #666666;
  --sp-text-light: #737373;
  --sp-text-lighter: #a3a3a3;

  /* Backgrounds */
  --sp-bg-light: #fdfdfd;
  --sp-input-bg: #f1f5f9;

  /* Borders */
  --sp-border: #e2e8f0;

  /* Gradients */
  --sp-gradient: linear-gradient(135deg, #ff4d00 0%, #ff8800 100%);
  --sp-gradient-text: linear-gradient(90deg, #ff4d00, #ff8800);

  /* Shadows */
  --sp-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --sp-shadow-hover: 0 20px 50px rgba(255, 77, 0, 0.15);
  --sp-card-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --sp-radius: 12px;
  --sp-radius-sm: 8px;
  --sp-radius-lg: 20px;
  --sp-radius-xl: 30px;
  --sp-radius-full: 50px;

  /* Spacing */
  --sp-spacing-xs: 10px;
  --sp-spacing-sm: 20px;
  --sp-spacing-md: 40px;
  --sp-spacing-lg: 60px;
  --sp-spacing-xl: 100px;

  /* Typography */
  --sp-font-family:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;

  /* Transitions */
  --sp-transition: all 0.3s ease;
  --sp-transition-slow: all 0.4s ease;
}

/* =========================================
   GLOBAL RESETS & BASE STYLES
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden !important;
  margin: 0;
  padding: 0;
  max-width: 100% !important;
}

/* Force full width for custom page templates */
#primary,
#main,
.site-content,
.site-content > .ast-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Keep header container at standard width */
.site-header .ast-container {
  max-width: 1240px !important;
  margin: 0 auto !important;
}

/* =========================================
   HEADER Z-INDEX FIXES
   ========================================= */
#masthead,
.site-header,
.ast-main-header-wrap,
.main-header-bar-wrap,
.ast-primary-header-bar,
.ast-primary-header,
.main-header-bar,
.site-primary-header-wrap {
  z-index: 999999 !important;
  overflow: visible !important;
}

/* Dropdown menus - highest z-index */
.sub-menu,
ul.sub-menu,
.ast-mobile-popup-drawer {
  z-index: 99999999 !important;
}

/* Mobile menu close button styling */
.ast-mobile-popup-drawer .menu-toggle-close {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 50% !important;
  width: 45px !important;
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: var(--sp-transition) !important;
}

.ast-mobile-popup-drawer .menu-toggle-close:hover {
  background: rgba(255, 77, 0, 0.2) !important;
  transform: rotate(90deg);
}

.ast-mobile-popup-drawer .menu-toggle-close .ast-svg-icon,
.ast-mobile-popup-drawer .menu-toggle-close svg {
  fill: #ffffff !important;
  width: 24px !important;
  height: 24px !important;
}

/* Mobile trigger visibility on light backgrounds */
.ast-header-break-point
  .ast-mobile-header-wrap
  .mobile-menu-toggle-icon
  .ast-mobile-svg {
  fill: var(--sp-dark, #1a1a1a) !important;
}

/* Page content lower z-index */
#content,
.site-content {
  position: relative;
  z-index: 1;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */

/* Container */
.ast-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Badge */
.sp-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 25px;
  background: rgba(255, 77, 0, 0.1);
  border: 1px solid rgba(255, 77, 0, 0.2);
  border-radius: var(--sp-radius-full);
  color: var(--sp-primary);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Buttons */
.elementor-button,
.sp-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 40px;
  border-radius: var(--sp-radius-full);
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition: var(--sp-transition);
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
}

.elementor-button:hover,
.sp-button:hover {
  transform: translateY(-2px);
}

/* =========================================
   ANIMATIONS
   ========================================= */

/* Reveal Animation */
.sp-reveal,
.sp-up {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.sp-reveal.is-visible,
.sp-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Float Animation */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.sp-float {
  animation: float 6s ease-in-out infinite;
}

/* Slide Up Animation */
@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Text Gradient Animation */
@keyframes textGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.sp-text-gradient {
  background: linear-gradient(120deg, var(--sp-primary), #ff9900, #ff4d00);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textGradient 4s linear infinite;
}

/* =========================================
   DECORATIVE ELEMENTS
   ========================================= */

/* Blobs */
.sp-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

.sp-blob-orange {
  background: var(--sp-primary);
  width: 200px;
  height: 200px;
}

.sp-blob-neutral {
  background: #333333;
  width: 300px;
  height: 300px;
}

/* Watermark Text */
.sp-watermark-text {
  position: absolute;
  font-size: 15rem;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.04);
  z-index: 0;
  pointer-events: none;
  line-height: 0.8;
  white-space: nowrap;
  user-select: none;
  font-family: "Arial Black", sans-serif;
}

/* =========================================
   RESPONSIVE UTILITIES
   ========================================= */
@media (max-width: 1200px) {
  .ast-container {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  :root {
    --sp-spacing-xl: 60px;
    --sp-spacing-lg: 40px;
  }
}

@media (max-width: 600px) {
  .ast-container {
    padding: 0 15px;
  }
}
