/* Custom styles for Mr. Mogul Maker website */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Toast notification slide in from right */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Cart badge bounce animation */
@keyframes cartBounce {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.3);
  }
  50% {
    transform: scale(0.9);
  }
  75% {
    transform: scale(1.2);
  }
}

/* Cart icon shake animation */
@keyframes cartShake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-3px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(3px);
  }
}

/* Product fly to cart animation */
@keyframes flyToCart {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(var(--tx), var(--ty)) scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0.1);
    opacity: 0;
  }
}

/* Success checkmark animation */
@keyframes checkmark {
  0% {
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(45deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(45deg);
    opacity: 1;
  }
}

/* Glow pulse effect */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

.animate-pulse-slow {
  animation: pulse 3s ease-in-out infinite;
}

/* Toast notification styles */
.toast-notification {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 9999;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 20px;
  min-width: 320px;
  animation: slideInRight 0.4s ease-out;
}

.toast-notification.hiding {
  animation: slideOutRight 0.4s ease-in;
}

.toast-notification.success {
  border-left: 4px solid #10b981;
}

.toast-notification.info {
  border-left: 4px solid #3b82f6;
}

/* Flying product animation */
.flying-product {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  animation: flyToCart 0.8s ease-in-out forwards;
}

/* Cart badge animations */
.cart-badge-bounce {
  animation: cartBounce 0.6s ease-out;
}

.cart-icon-shake {
  animation: cartShake 0.5s ease-out;
}

.cart-glow {
  animation: glowPulse 1s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: #fbbf24;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #f59e0b;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Custom button hover effects */
.btn-hover-lift {
  transition: all 0.3s ease;
}

.btn-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(251, 191, 36, 0.3);
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Loading animation for images */
img {
  transition: opacity 0.3s ease;
}

img:not([src]) {
  opacity: 0;
}

/* Responsive video containers */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
}

/* Accessibility improvements */
a:focus,
button:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

/* Dark mode support (if needed later) */
@media (prefers-color-scheme: dark) {
  /* Styles are already dark, no changes needed */
}

/* ============================================
   MOBILE ENHANCEMENTS
   ============================================ */

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
  /* Enhanced mobile menu animation */
  #mobile-menu {
    transition: opacity 0.3s ease-in-out;
  }
  
  #mobile-menu.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  #mobile-menu:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Mobile menu items staggered animation */
  #mobile-menu a {
    animation: slideInFromLeft 0.4s ease-out backwards;
  }
  
  #mobile-menu a:nth-child(1) { animation-delay: 0.1s; }
  #mobile-menu a:nth-child(2) { animation-delay: 0.2s; }
  #mobile-menu a:nth-child(3) { animation-delay: 0.3s; }
  #mobile-menu a:nth-child(4) { animation-delay: 0.4s; }
  #mobile-menu a:nth-child(5) { animation-delay: 0.5s; }
  
  @keyframes slideInFromLeft {
    from {
      opacity: 0;
      transform: translateX(-30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  /* Mobile hamburger menu animation */
  #mobile-menu-btn {
    position: relative;
    padding: 8px;
    transition: transform 0.3s ease;
  }
  
  #mobile-menu-btn:active {
    transform: scale(0.95);
  }
  
  /* Improved touch targets for mobile */
  button,
  a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Mobile hero section adjustments */
  .hero-content {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  
  /* Mobile typography improvements */
  h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
  }
  
  h2 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }
  
  h3 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
  }
  
  p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }
  
  /* Mobile button improvements */
  .btn,
  button,
  a[class*="px-"] {
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
    border-radius: 9999px;
    transition: all 0.3s ease;
  }
  
  /* Mobile card spacing */
  .card,
  [class*="rounded-"] {
    margin-bottom: 1.5rem;
  }
  
  /* Mobile section padding */
  section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  /* Mobile image optimization */
  img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
  }
  
  /* Mobile form improvements */
  input,
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 1rem !important;
  }
  
  /* Mobile video container */
  .video-container {
    margin-bottom: 1.5rem;
  }
  
  /* Mobile-friendly product cards */
  .product-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
  
  /* Mobile shopping cart improvements */
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  /* Mobile modal adjustments */
  .modal,
  [class*="fixed"] {
    padding: 1rem;
  }
  
  /* Mobile footer improvements */
  footer {
    text-align: center;
  }
  
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  
  /* Mobile stats section */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
  }
  
  /* Mobile programs grid */
  .programs-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

/* Tablet-specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  h1 {
    font-size: 3.5rem !important;
  }
  
  h2 {
    font-size: 2.5rem !important;
  }
  
  .programs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Small mobile devices */
@media (max-width: 380px) {
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
  }
  
  .btn,
  button {
    padding: 0.875rem 1.25rem !important;
    font-size: 0.9rem !important;
  }
  
  /* Extra small screen adjustments */
  .stats-grid,
  .programs-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Landscape orientation mobile */
@media (max-width: 768px) and (orientation: landscape) {
  section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  .hero-content {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets */
  a, button, input[type="button"], input[type="submit"] {
    min-height: 48px;
    min-width: 48px;
  }
  
  /* Remove hover effects on touch devices */
  .card-hover:hover {
    transform: none;
  }
  
  /* Add active state for touch feedback */
  button:active,
  a:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
  
  /* Improve scrolling performance */
  * {
    -webkit-overflow-scrolling: touch;
  }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari viewport height fix */
  .min-h-screen {
    min-height: -webkit-fill-available;
  }
  
  /* Prevent iOS zoom on form inputs */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
  /* Reduce motion for better performance */
  @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;
    }
  }
  
  /* Optimize rendering */
  .card,
  [class*="rounded-"],
  img {
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}

/* ============================================
   SWIPE GESTURE ENHANCEMENTS
   ============================================ */

/* Video Carousel Swipe Support */
#video-carousel {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#video-carousel:active {
  cursor: grabbing;
}

#video-slides {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Prevent text selection during swipe */
#video-carousel * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Re-enable text selection for video info */
#video-carousel .p-4 h4,
#video-carousel .p-4 p {
  user-select: text;
  -webkit-user-select: text;
}

/* Swipe indicator visual feedback */
@keyframes swipeHint {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(-10px);
    opacity: 0.7;
  }
}

/* Show swipe hint on first load (optional) */
.swipe-hint {
  animation: swipeHint 1.5s ease-in-out 2;
}

/* Improved carousel navigation buttons for touch */
#video-prev,
#video-next {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Better touch feedback for carousel indicators */
.video-indicator {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.video-indicator:active {
  transform: scale(1.3);
}

/* Mobile-specific swipe optimizations */
@media (max-width: 768px) {
  #video-carousel {
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Slightly faster transition on mobile */
  #video-slides {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Mobile Menu Swipe Support */
#mobile-menu {
  touch-action: pan-x;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#mobile-menu.hidden {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

#mobile-menu:not(.hidden) {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Left edge swipe indicator (subtle visual cue) */
@media (max-width: 768px) {
  body::before {
    content: '';
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60px;
    background: linear-gradient(to right, rgba(251, 191, 36, 0.5), transparent);
    border-radius: 0 3px 3px 0;
    z-index: 45;
    opacity: 0.3;
    transition: opacity 0.3s;
  }
  
  body:active::before {
    opacity: 0.7;
  }
}

/* Prevent text selection during menu swipe */
body.menu-swiping {
  user-select: none;
  -webkit-user-select: none;
}
