/* ==========================================================================
   JACAJUICE.CO.ZA — ENHANCED GLOBAL STYLESHEET
   Compatible with SPA Navigation System
   ========================================================================== */

/* ─────────────────────────────
   ENHANCED CSS VARIABLES
   ───────────────────────────── */
:root {
  /* Enhanced transitions for SPA */
  --page-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --card-transition: transform 0.3s ease, box-shadow 0.3s ease;
  
  /* Enhanced shadows */
  --shadow-soft: 0 2px 20px rgba(0,0,0,0.08);
  --shadow-medium: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-float: 0 15px 40px rgba(0,0,0,0.15);
  
  /* Enhanced brand colors */
  --jaca-orange-glow: rgba(255, 106, 0, 0.15);
  --ice-blue-glow: rgba(0, 180, 255, 0.15);
}

/* ─────────────────────────────
   SPA TRANSITION ENHANCEMENTS
   ───────────────────────────── */
.page-exit #main-content {
  opacity: 0;
  transform: translateY(20px);
  transition: var(--page-transition);
}

.page-enter #main-content {
  opacity: 1;
  transform: translateY(0);
  transition: var(--page-transition);
}

/* ─────────────────────────────
   ENHANCED COMPONENT STYLES
   ───────────────────────────── */

/* About Section Enhancements */
.about-content {
  position: relative;
}

.about-content::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: var(--brand-gradient);
  border-radius: var(--radius-lg);
  opacity: 0.05;
  z-index: -1;
}

/* Services Enhancements */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s ease;
}

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

/* Gallery Enhancements */
.gallery-item {
  position: relative;
  cursor: pointer;
}

.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: var(--radius);
}

.gallery-item:hover::after {
  opacity: 0.1;
}

/* FAQ Enhancements */
.faq-question {
  position: relative;
  padding-right: 3rem;
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 300;
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
  content: '−';
  transform: translateY(-50%) rotate(0deg);
}

/* Blog Card Enhancements */
.blog-card {
  position: relative;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.blog-card:hover::before {
  transform: scaleX(1);
}

/* Testimonial Enhancements */
.testimonial-card {
  position: relative;
}

.testimonial-rating {
  color: #FFD700;
  margin-bottom: 1rem;
}

/* E-commerce Enhancements */
.product-card {
  position: relative;
}

.wishlist-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
}

.product-card:hover .wishlist-btn {
  opacity: 1;
}

.wishlist-btn.active {
  color: var(--jaca-red);
  opacity: 1;
}

/* Cart Badge */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--jaca-red);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Checkout Progress */
.checkout-progress {
  display: flex;
  margin-bottom: 3rem;
  position: relative;
}

.checkout-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-light);
  z-index: 1;
}

.progress-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 2;
}

.step-indicator {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  transition: var(--transition);
}

.progress-step.active .step-indicator {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

.progress-step.completed .step-indicator {
  background: var(--jaca-green);
  border-color: var(--jaca-green);
  color: white;
}

/* Form Enhancements */
.form-group {
  position: relative;
}

.form-floating {
  position: relative;
}

.form-floating .form-control {
  height: calc(3.5rem + 2px);
  padding: 1rem 0.75rem;
}

.form-floating label {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  padding: 1rem 0.75rem;
  pointer-events: none;
  border: 1px solid transparent;
  transform-origin: 0 0;
  transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
  opacity: 0.65;
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Login Form Enhancements */
.auth-card {
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
}

/* Dashboard Enhancements */
.sidebar-nav .nav-item {
  margin-bottom: 0.5rem;
}

.sidebar-nav .nav-link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
  color: var(--text-dark);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: var(--brand-primary);
  color: white;
}

/* ─────────────────────────────
   MICRO-INTERACTIONS
   ───────────────────────────── */

/* Loading States */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: button-spinner 0.8s linear infinite;
}

@keyframes button-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hover Glow Effects */
.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px var(--jaca-orange-glow);
}

body.phatice .hover-glow:hover {
  box-shadow: 0 0 20px var(--ice-blue-glow);
}

/* Staggered Animations */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────
   ACCESSIBILITY ENHANCEMENTS
   ───────────────────────────── */

/* Focus visible improvements */
.focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Skip to main content */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--brand-primary);
  color: white;
  padding: 8px;
  border-radius: var(--radius);
  text-decoration: none;
  z-index: 10000;
}

.skip-link:focus {
  top: 6px;
}

/* High contrast support */
@media (prefers-contrast: high) {
  :root {
    --shadow: 0 0 0 1px currentColor;
    --shadow-md: 0 0 0 2px currentColor;
  }
  
  .card {
    border: 2px solid currentColor;
  }
}

/* ─────────────────────────────
   RESPONSIVE ENHANCEMENTS
   ───────────────────────────── */

@media (max-width: 768px) {
  /* Mobile-first cart */
  .cart-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
  }
  
  /* Mobile navigation enhancements */
  .mobile-menu-open {
    overflow: hidden;
  }
  
  /* Touch-friendly buttons */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ─────────────────────────────
   UTILITY CLASSES (Add-ons)
   ───────────────────────────── */

.glass-effect {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

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

.shadow-glow {
  box-shadow: 0 0 30px var(--jaca-orange-glow);
}

body.phatice .shadow-glow {
  box-shadow: 0 0 30px var(--ice-blue-glow);
}

/* ─────────────────────────────
   DARK MODE ENHANCEMENTS
   ───────────────────────────── */

@media (prefers-color-scheme: dark) {
  .glass-effect {
    background: rgba(45, 45, 45, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ─────────────────────────────
   COMPATIBILITY ASSURANCE
   ───────────────────────────── */

/* Ensure compatibility with existing SPA system */
#main-content {
  position: relative;
  z-index: 1;
}

/* Progress bar compatibility */
#page-progress-bar {
  z-index: 9999;
}

/* Smooth scrolling compatibility */
html {
  scroll-behavior: smooth;
}

/* Prevent FOUC during SPA transitions */
.spa-transitioning {
  pointer-events: none;
}