/* Umar Electric - Main Stylesheet */

/* Base Styles */
html {
  scrollbar-gutter: stable;
}

html, body {
  overflow-x: hidden;
}

body { 
  font-family: 'Inter', sans-serif;
}

/* Performance optimizations */
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* Reduce layout shifts */
.lazy-image {
  aspect-ratio: 1;
}

/* Modern CSS features */
:root {
  --primary-color: #dc2626;
  --secondary-color: #374151;
  --accent-color: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  
  /* Performance optimized transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-smooth: 0.8s ease;
  
  /* Animation durations */
  --animation-fast: 0.3s;
  --animation-normal: 0.5s;
  --animation-slow: 1s;
}

/* Focus management for accessibility */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}



/* Glass Effect */
.glass {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
}

/* Product Cards */
.product-card { 
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.05), transparent);
  transition: left 0.5s;
}

.product-card:hover::before {
  left: 100%;
}

.product-card:hover { 
  transform: translateY(-8px); 
  box-shadow: 0 25px 50px -12px rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.2);
}

/* ============================================
   OPTIMIZED NAVBAR STYLES
   ============================================ */

/* Navigation Links */
.nav-link {
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #dc2626;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Animations */
.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.3); }
  50% { box-shadow: 0 0 40px rgba(220, 38, 38, 0.6); }
}

/* Smooth Scroll */
html {
  scroll-padding-top: 120px; /* Adjusted for info bar + navbar */
}

/* Focus Styles for Accessibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

a:focus:not(:focus-visible), button:focus:not(:focus-visible) {
  outline: none;
}

/* Selection Color */
::selection {
  background-color: #dc2626;
  color: white;
}

::-moz-selection {
  background-color: #dc2626;
  color: white;
}

/* OPTIMIZED: Navbar with GPU acceleration */
#main-navbar {
  transition: background-color 0.3s ease-in-out, 
              box-shadow 0.3s ease-in-out,
              backdrop-filter 0.3s ease-in-out;
  will-change: background-color, backdrop-filter;
}

#main-navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px); /* Safari support */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  will-change: auto; /* Reset after transition */
}

#main-navbar.scrolled .navbar-link {
  color: #374151 !important;
  transition: color 0.3s ease-in-out;
}

#main-navbar.scrolled .navbar-link:hover {
  color: #dc2626 !important;
}

#main-navbar.scrolled #mobile-menu-button {
  color: #374151 !important;
  transition: color 0.3s ease-in-out;
}

#main-navbar.scrolled #mobile-menu-button:hover {
  color: #dc2626 !important;
}

/* OPTIMIZED: Scrolling Info Bar with GPU acceleration */
.scrolling-text {
  display: inline-flex;
  animation: scroll-left 30s linear infinite;
  padding-left: 100%;
  will-change: transform; /* GPU acceleration */
}

.scrolling-text:hover {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translate3d(0, 0, 0); /* Use 3D transform for GPU */
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/* OPTIMIZED: Mobile Menu with 3D transforms */
#mobile-menu {
  transform: translate3d(100%, 0, 0); /* GPU accelerated */
  will-change: transform;
}

#mobile-menu.translate-x-0 {
  transform: translate3d(0, 0, 0);
}

#mobile-menu.translate-x-full {
  transform: translate3d(100%, 0, 0);
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
  transition: opacity 0.3s ease-in-out;
}

/* Hero Section - Optimized */
.hero-simple {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.hero-bg-simple {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  will-change: opacity;
}

.hero-bg-simple.active {
  opacity: 1;
}

/* Hero Section Padding Adjustment */
.hero-content-simple {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-top: 8rem; /* Account for navbar height (40px info bar + 80px navbar) */
}

.hero-dots {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  z-index: 20;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: #dc2626;
  transform: scale(1.2);
}

.dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* OPTIMIZED: Mobile Menu with 3D transforms */
#mobile-menu {
  transform: translate3d(100%, 0, 0); /* GPU accelerated */
  will-change: transform;
}

#mobile-menu.translate-x-0 {
  transform: translate3d(0, 0, 0);
}

#mobile-menu.translate-x-full {
  transform: translate3d(100%, 0, 0);
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
  transition: opacity 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-content-simple {
    padding: 1rem;
    padding-top: 6rem; /* Reduced padding for mobile */
  }
  
  /* Reduce animation complexity on mobile */
  .scrolling-text {
    animation-duration: 40s; /* Slower on mobile for better performance */
  }
}

/* Tablet specific adjustments - FIXES TEXT POSITIONING */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero-content-simple {
    padding-top: 12rem; /* Increased padding for Surface Pro 7 and tablets */
    padding-bottom: 4rem;
    justify-content: flex-start; /* Align content to top instead of center */
    align-items: flex-start;
  }
  
  .hero-simple {
    min-height: 100vh;
  }
  
  /* Adjust text positioning for better visibility */
  .hero-content-simple .max-w-7xl {
    margin-top: 2rem; /* Additional margin for better spacing */
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .scrolling-text {
    animation: none;
    padding-left: 1rem;
  }
  
  .nav-link,
  #main-navbar,
  #mobile-menu {
    transition: none;
  }
}


/* Mobile Filter Enhancements */
.mobile-category-toggle {
  transition: all 0.2s ease;
}

.mobile-category-toggle:hover {
  background-color: #f9fafb;
}

.mobile-nested-categories {
  transition: all 0.3s ease;
  overflow: hidden;
}

.mobile-expand-arrow {
  transition: transform 0.2s ease;
  font-size: 12px;
}

.mobile-category-toggle:hover .mobile-expand-arrow {
  color: #dc2626;
}

/* Lazy Loading Images */
.lazy-image {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #f8f8f8 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s ease-in-out infinite;
}

.lazy-image.loaded {
  opacity: 1;
  animation: none;
  background: none;
}

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

