/* Animations and responsive enhancements for Noor Bakery */

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 1s ease-in-out;
}

/* Slide-in from bottom animation */
@keyframes slideInBottom {
  from { 
    transform: translateY(50px);
    opacity: 0;
  }
  to { 
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in-bottom {
  animation: slideInBottom 0.8s ease-out;
}

/* Slide-in from left animation */
@keyframes slideInLeft {
  from { 
    transform: translateX(-50px);
    opacity: 0;
  }
  to { 
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-out;
}

/* Slide-in from right animation */
@keyframes slideInRight {
  from { 
    transform: translateX(50px);
    opacity: 0;
  }
  to { 
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

/* Pulse animation for attention */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Grow on hover */
.grow-hover {
  transition: transform 0.3s ease;
}

.grow-hover:hover {
  transform: scale(1.05);
}

/* Animated underline on hover */
.hover-underline {
  position: relative;
  text-decoration: none !important;
}

.hover-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--bakery-primary);
  transition: width 0.3s ease;
}

.hover-underline:hover::after {
  width: 100%;
}

/* Custom hover for navbar links */
.navbar-dark .navbar-nav .nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--bakery-accent);
  transition: width 0.3s ease, left 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover::after,
.navbar-dark .navbar-nav .nav-link.active::after {
  width: 100%;
  left: 0;
}

/* Bounce animation for buttons */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
  40% {transform: translateY(-10px);}
  60% {transform: translateY(-5px);}
}

.bounce-hover:hover {
  animation: bounce 1s;
}

/* Animated icon rotation */
.rotate-hover {
  transition: transform 0.5s ease;
}

.rotate-hover:hover {
  transform: rotate(15deg);
}

/* Shimmer effect for featured products */
@keyframes shimmer {
  0% {
    background-position: -100px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 2s infinite;
}

/* Responsive Improvements */
/* Custom styles for different devices */

/* Small devices (landscape phones) */
@media (max-width: 576px) {
  .bakery-heading {
    font-size: 1.8rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-section {
    padding: 30px 0;
  }
  
  .navbar-brand {
    font-size: 1.5rem;
  }
  
  .card-deck .card {
    margin-bottom: 15px;
  }
  
  /* Increase touch targets for mobile */
  .btn {
    padding: 0.5rem 1rem;
  }
  
  /* Improve readability on small screens */
  p, .card-text {
    font-size: 1rem;
    line-height: 1.5;
  }
  
  /* Adjust spacing for mobile */
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  .my-5 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }
  
  /* Make forms more mobile-friendly */
  input, select, textarea {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }
}

/* Medium devices (tablets) */
@media (max-width: 768px) {
  .admin-sidebar {
    margin-bottom: 20px;
  }
  
  /* Add space between stacked columns on medium screens */
  .col-md-6:not(:last-child) {
    margin-bottom: 20px;
  }
  
  /* Make tables responsive on tablets */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Custom pagination styles for better mobile experience */
.pagination .page-link {
  padding: 0.5rem 0.75rem;
  margin: 0 0.15rem;
  border-radius: 4px;
}

/* Improved form styles for mobile */
.form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(139, 90, 43, 0.25);
}

/* Accessibility improvements */
.btn:focus, .form-control:focus {
  outline: 2px solid var(--bakery-primary);
}

/* Better hover effects for touch devices */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-5px);
  }
}

/* Utility classes for staggered animations */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }
.delay-5 { animation-delay: 1s; }