/* ========================================
   Rzza Training Platform - Main Styles
   ======================================== */

/* ============================================
   1. CSS VARIABLES
   ============================================ */
:root {
  --primary-color: #8B5CF6;    /* Purple */
  --secondary-color: #1F2937;  /* Dark Gray */
  --accent-color: #F59E0B;     /* Amber */
  --base-font: 'Cairo', sans-serif;
}

/* ============================================
   2. GLOBAL STYLES
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  position: relative;
  font-family: var(--base-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #0f172a;
  background: #ffffff;
}

* {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) white;
}

/* ============================================
   3. SCROLLBAR STYLES
   ============================================ */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: white;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 999px;
}

/* ============================================
   4. ACCESSIBILITY
   ============================================ */

/* Focus styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-aos] {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ============================================
   5. ANIMATIONS & KEYFRAMES
   ============================================ */

@keyframes blob {
  0%, 100% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* ============================================
   6. HEADER STYLES
   ============================================ */

#mainHeader.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Mobile Menu Toggle Animation */
#menuToggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

#menuToggle.active span:nth-child(2) {
  opacity: 0;
}

#menuToggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Sidebar States */
#mobileSidebar.active {
  transform: translateX(0);
}

#sidebarOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   7. SCROLL TO TOP BUTTON
   ============================================ */

#scrollTopBtn {
  transform: translateY(20px);
}

#scrollTopBtn.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0);
}

/* ============================================
   8. PRODUCTS PAGE - FILTERS SIDEBAR
   ============================================ */

/* Active category button */
.category-btn.active {
  background-color: black !important;
  color: white !important;
}

.category-btn.active i,
.category-btn.active span {
  color: white !important;
}

.category-btn.active:hover {
  background-color: #333333 !important;
}

/* Desktop Sidebar */
.desktop-sidebar {
  display: block;
}

/* Mobile Sidebar */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 90%;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: none;
}

.mobile-sidebar.open {
  right: 0;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle {
  position: fixed;
  bottom: 30px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #7C3AED);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  z-index: 999;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
}

.mobile-sidebar-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.mobile-sidebar-toggle:active {
  transform: scale(0.95);
}

.sidebar-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), #7C3AED);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.sidebar-content {
  padding: 1rem;
}

/* ============================================
   9. PRODUCT DETAILS PAGE
   ============================================ */

/* Product Gallery */
.productGalleryThumbs .swiper-slide {
  opacity: 0.4;
  transition: opacity 0.3s;
}

.productGalleryThumbs .swiper-slide-thumb-active {
  opacity: 1;
  border: 2px solid var(--primary-color);
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--primary-color);
}

.product-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ============================================
   10. RESPONSIVE DESIGN
   ============================================ */

/* Desktop (≥1024px) */
@media (min-width: 1024px) {
  .mobile-sidebar-toggle {
    display: none;
  }

  .mobile-sidebar {
    display: none;
  }

  .sidebar-overlay {
    display: none;
  }
}

/* Mobile & Tablet (<1024px) */
@media (max-width: 1023px) {
  .mobile-sidebar-toggle {
    display: flex;
  }

  .mobile-sidebar {
    display: block;
  }

  .desktop-sidebar {
    display: none;
  }

  /* Prevent body scroll when sidebar is open */
  body.sidebar-open {
    overflow: hidden;
  }
}

/* Small screens */
@media (max-width: 640px) {
  #home h2 {
    font-size: 2rem;
  }
}