/**
 * Custom Stylesheet
 *
 * File Path: /assets/css/style.css
 *
 * This file contains custom CSS rules and animations that complement Tailwind CSS.
 * It's used for effects that are difficult or verbose to achieve with utility classes alone.
 *
 * @package     ResourceHeaven
 * @author      Your Name
 * @version     1.0.0
 * @since       2025-06-22
 */

/* --- Keyframe Animations for Form Validation --- */

/* Shake animation for error state */
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* --- Validation State Classes --- */

/* Class to apply to the input field on validation error */
.input-error {
  /* Apply the shake animation */
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
  
  /* Use Tailwind's color variables for consistency */
  --tw-border-opacity: 1;
  border-color: rgb(239 68 68 / var(--tw-border-opacity)); /* red-500 */
  
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(252 165 165 / var(--tw-ring-opacity)); /* red-300 */
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

/* Class to apply to the icon when its associated input has an error */
.icon-error i {
    --tw-text-opacity: 1;
    color: rgb(239 68 68 / var(--tw-text-opacity)); /* red-500 */
}


/* --- General UI Enhancements --- */

/* Change icon color when the input field is focused for better UX */
input:focus ~ .pointer-events-none i {
    --tw-text-opacity: 1;
    color: rgb(59 130 246 / var(--tw-text-opacity)); /* blue-500 */
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

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

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

@keyframes blink {
    50% { border-color: transparent; }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

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

.animate-typing {
    overflow: hidden;
    border-right: 3px solid;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* Hover enhancements */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

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

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Carousel styles (removed - testimonials now use grid layout) */

/* Pricing card expansion */
.pricing-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.pricing-card:hover .pricing-details {
    max-height: 200px;
    opacity: 1;
}

.pricing-details {
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

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

/* Performance optimizations for low-end devices */
.reduce-animations .animate-fade-in-up,
.reduce-animations .animate-fade-in-left,
.reduce-animations .animate-fade-in-right,
.reduce-animations .animate-scale-in,
.reduce-animations .animate-float,
.reduce-animations .animate-typing {
    animation-duration: 0.3s !important;
    animation-delay: 0s !important;
}

.reduce-animations .hover-lift:hover,
.reduce-animations .hover-scale:hover {
    transform: none !important;
}

.reduce-animations .hover-glow:hover {
    box-shadow: none !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-scale-in {
        animation-duration: 0.6s;
    }

    .hover-lift:hover {
        transform: translateY(-4px);
    }
}

