/* 
=============================================
Enhanced Animations for Eazy Fatoora
Modern, Smooth, and Performance-Optimized
Production-Ready with Best Practices
=============================================
*/

/* ============================================
   PERFORMANCE OPTIMIZATION
   ============================================ */

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Performance Optimization - Only animate transforming elements */
.main-blue-button a,
.main-red-button a,
.main-white-button a,
.pricing-item,
.our-portfolio .item,
.our-blog .left-image,
.about-us .services .item {
  will-change: transform;
}

/* Remove will-change after animation completes for memory efficiency */
.animation-complete {
  will-change: auto;
}

/* Enhanced Button Animations */
/* Reset parent container styles to prevent border effects */
.main-blue-button,
.main-red-button,
.main-white-button {
  display: inline-block;
  border: none !important;
  outline: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Prevent parent li from inheriting button styles */
.header-area .main-nav .nav li:last-child {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Apply all styles only to the anchor tag */
.main-blue-button a,
.main-red-button a,
.main-white-button a {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: inline-block;
  border: none;
  outline: none;
}

.main-blue-button a::before,
.main-red-button a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
  z-index: 0;
}

.main-blue-button a:hover::before,
.main-red-button a:hover::before {
  width: 300px;
  height: 300px;
}

.main-blue-button a:hover,
.main-red-button a:hover,
.main-white-button a:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.main-blue-button a:active,
.main-red-button a:active,
.main-white-button a:active {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Ensure focus styles are only on the anchor */
.main-blue-button a:focus,
.main-red-button a:focus,
.main-white-button a:focus {
  outline: 2px solid #03a4ed;
  outline-offset: 3px;
}

/* Prevent any parent container from getting hover effects */
.main-blue-button:hover,
.main-red-button:hover,
.main-white-button:hover {
  border: none !important;
  outline: none !important;
  background: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Header Logo Animation */
.header-area .main-nav .logo h4 {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-area .main-nav .logo:hover h4 {
  transform: scale(1.05);
  letter-spacing: 3px;
}

/* Enhanced Nav Link Animations */
.header-area .main-nav .nav li a {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-area .main-nav .nav li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #03a4ed, #fe3f40);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

.header-area .main-nav .nav li:hover a::after,
.header-area .main-nav .nav li a.active::after {
  width: 80%;
}

.header-area .main-nav .nav li:hover a {
  transform: translateY(-2px);
}

/* Banner Text Animations */
.main-banner .left-content h6 {
  animation: slideInLeft 0.8s ease-out;
}

.main-banner .left-content h2 {
  animation: slideInLeft 1s ease-out 0.2s both;
}

.main-banner .left-content p {
  animation: slideInLeft 1.2s ease-out 0.4s both;
}

.main-banner .left-content .main-red-button {
  animation: slideInLeft 1.4s ease-out 0.6s both;
}

/* Banner Image Animation */
.main-banner .right-image {
  animation: zoomInFade 1.2s ease-out 0.3s both;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-banner .right-image:hover {
  transform: scale(1.03) rotate(1deg);
}

.main-banner .right-image img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-banner .right-image:hover img {
  transform: scale(1.05);
}

/* About Us Service Items */
.about-us .services .item {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(30px);
}

.about-us .services .item.animated {
  opacity: 1;
  transform: translateY(0);
}

.about-us .services .item:hover {
  transform: translateX(10px) translateY(0);
}

.about-us .services .item .icon {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-us .services .item:hover .icon {
  transform: rotateY(360deg) scale(1.1);
}

.about-us .services .item h4 {
  transition: color 0.3s ease;
}

.about-us .services .item:hover h4 {
  color: #03a4ed !important;
}

/* Make services cards equal height globally */
.about-us .services .row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.about-us .services .row > [class*='col-'] {
  display: flex;
  flex-direction: column;
}

.about-us .services .item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-grow: 1;
  height: auto;
}

.about-us .services .item .icon {
  flex-shrink: 0;
}

.about-us .services .item .right-text {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Progress Bar Animations */
.our-services .progress-skill-bar .filled-bar {
  width: 0 !important;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.our-services .progress-skill-bar.animate .filled-bar {
  animation: fillBar 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.our-services .first-bar.animate .filled-bar {
  animation: fillBar100 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.our-services .second-bar.animate .filled-bar {
  animation: fillBar95 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.our-services .third-bar.animate .filled-bar {
  animation: fillBar98 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Portfolio Cards Enhanced */
.our-portfolio .item {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.our-portfolio .item:hover {
  transform: translateY(-10px) scale(1.02);
}

.our-portfolio .hidden-content {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: none;
}

.our-portfolio .showed-content {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: none;
}

.our-portfolio .showed-content:hover {
  box-shadow: 0px 15px 40px rgba(0,0,0,0.15);
}

.our-portfolio .showed-content img {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.our-portfolio .showed-content:hover img {
  transform: scale(1.15) rotate(5deg);
}

/* Blog Section Animations */
.our-blog .left-image {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.our-blog .left-image:hover {
  transform: translateY(-5px);
}

.our-blog .left-image:hover img {
  transform: scale(1.05);
}

.our-blog .left-image img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.our-blog .left-image .info .inner-content {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.our-blog .left-image:hover .info .inner-content {
  transform: translateY(-10px);
  box-shadow: 0px 15px 30px rgba(0,0,0,0.15);
}

.our-blog .right-list ul li {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.our-blog .right-list ul li:hover {
  transform: translateX(10px);
  background: rgba(3, 164, 237, 0.05);
  padding: 15px;
  border-radius: 15px;
}

.our-blog .right-list .right-image img {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.our-blog .right-list ul li:hover .right-image img {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Pricing Cards Enhanced */
.pricing-item {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.pricing-item:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0px 20px 40px rgba(0,0,0,0.2);
}

.pricing-item.featured {
  animation: pulse 2s ease-in-out infinite;
}

.pricing-item.featured:hover {
  animation: none;
  transform: scale(1.08) translateY(-15px);
}

.featured-badge {
  animation: bounceIn 0.8s ease-out;
}

.pricing-header h3 {
  transition: all 0.3s ease;
}

.pricing-item:hover .pricing-header h3 {
  transform: scale(1.1);
}

.price .amount {
  transition: all 0.3s ease;
}

.pricing-item:hover .price .amount {
  transform: scale(1.15);
  color: #fe3f40;
}

.pricing-item.featured:hover .price .amount {
  color: #fff;
}

.pricing-features li {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding-left: 10px;
}

.pricing-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #03a4ed, #fe3f40);
  transition: width 0.3s ease;
  transform: translateY(-50%);
}

.pricing-item:hover .pricing-features li::before {
  width: 5px;
}

.pricing-features li:hover {
  padding-left: 20px;
  color: #03a4ed;
}

.pricing-item.featured .pricing-features li:hover {
  color: #fff;
}

/* Contact Form Animations */
#contact fieldset {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#contact input,
#contact textarea {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2eaf2;
}

#contact input:focus,
#contact textarea:focus {
  transform: scale(1.02);
  border: 1px solid #03a4ed;
  box-shadow: 0 5px 20px rgba(3, 164, 237, 0.2);
}

#contact button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

#contact button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

#contact button:hover::before {
  width: 300px;
  height: 300px;
}

#contact button:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
}

/* Keyframe Animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoomInFade {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fillBar100 {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes fillBar95 {
  from {
    width: 0;
  }
  to {
    width: 95%;
  }
}

@keyframes fillBar98 {
  from {
    width: 0;
  }
  to {
    width: 98%;
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0px 0px 15px rgba(254, 63, 64, 0.3);
  }
  50% {
    box-shadow: 0px 0px 30px rgba(254, 63, 64, 0.6);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.3);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

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

/* Floating Animation for Images */
.float-animation {
  animation: float 3s ease-in-out infinite;
}

/* Fade In Up on Scroll */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger Effect */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }

/* Image Hover Effects */
img {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Section Divider Animation */
.section-heading h2 {
  position: relative;
  display: inline-block;
}

.section-heading h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #03a4ed, #fe3f40);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-heading h2.visible::after {
  width: 100%;
}

/* Smooth Color Transitions */
.section-heading h2 em,
.section-heading h2 span {
  transition: all 0.3s ease;
}

.section-heading:hover h2 em {
  color: #fe3f40;
}

.section-heading:hover h2 span {
  color: #03a4ed;
}

/* Preloader Enhancement */
.js-preloader {
  backdrop-filter: blur(10px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Footer Fade In */
footer {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

footer.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Animations - Disable on Mobile for Performance */
@media (max-width: 768px) {
  * {
    animation-duration: 0.3s !important;
  }
  
  .pricing-item.featured {
    animation: none;
  }
  
  .float-animation {
    animation: none;
  }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION SUPPORT
   ============================================ */
@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;
  }
  
  /* Ensure focus indicators remain visible */
  *:focus {
    outline: 2px solid #03a4ed !important;
    outline-offset: 2px !important;
  }
}

/* Smooth Page Transitions */
body {
  opacity: 0;
  animation: fadeInBody 0.5s ease-in forwards;
}

@keyframes fadeInBody {
  to {
    opacity: 1;
  }
}

/* Counter Animation for Pricing */
@keyframes countUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.price .amount {
  animation: countUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glow Effect on Hover */
.glow-on-hover {
  transition: all 0.3s ease;
}

.glow-on-hover:hover {
  box-shadow: 0 0 20px rgba(3, 164, 237, 0.5),
              0 0 40px rgba(3, 164, 237, 0.3),
              0 0 60px rgba(3, 164, 237, 0.1);
}

/* Slide In From Sides */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scale Up Animation */
@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.scale-up {
  animation: scaleUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pricing Meta Info Animation */
.pricing-meta {
  transition: all 0.3s ease;
  opacity: 0.7;
  color: #ffffff;
}

.pricing-item:hover .pricing-meta {
  opacity: 1;
  transform: translateY(-5px);
}

/* ============================================
   PRICING CARD ALIGNMENT FIX
   ============================================ */

/* Make pricing row use flexbox with equal heights */
.pricing-section .row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

/* Ensure pricing columns take full height */
.pricing-section .row > [class*='col-'] {
  display: flex;
  flex-direction: column;
}

/* Make pricing item a flex container to push button to bottom */
.pricing-item {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: auto !important;
}

/* Flex grow for content area to push button down */
.pricing-features {
  flex-grow: 1;
}

/* Ensure meta and button stay at bottom */
.pricing-meta {
  margin-top: auto;
  padding-top: 20px;
}

.pricing-button {
  margin-top: 20px;
  margin-bottom: 0;
}

/* Override any conflicting margin-bottom from pricing-item */
.pricing-item {
  margin-bottom: 30px !important;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .pricing-section .row > [class*='col-'] {
    margin-bottom: 30px;
  }
}
