/* =====================================================
   VARDHAMAN ENGINEERING WEBSITE - ANIMATIONS CSS
   Foundation animations inspired by Homy design
   ===================================================== */

/* ===== ROOT VARIABLES ===== */
:root {
    /* Colors - Updated to match brand theme */
    --primary-blue: #334e2b;
    --primary-dark: #20331c;
    --secondary-gray: #333333;
    --accent-orange: #E07B39;
    --light-bg: #F5F5F5;
    --white: #FFFFFF;
    --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.14);
    --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.2);
    
    /* Animation Timing */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-extra-slow: 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Spacing */
    --spacing-base: 16px;
    --spacing-lg: 32px;
    --spacing-xl: 64px;
}

/* ===== FADE IN ANIMATIONS ===== */

/* Fade in on page load */
@keyframes fadeInPage {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in-page {
    animation: fadeInPage 400ms ease-out forwards;
}

/* Fade in on scroll */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn var(--transition-normal) forwards;
}

/* Fade in with delay */
.fade-in-delay-1 { animation: fadeIn var(--transition-normal) 100ms forwards; }
.fade-in-delay-2 { animation: fadeIn var(--transition-normal) 200ms forwards; }
.fade-in-delay-3 { animation: fadeIn var(--transition-normal) 300ms forwards; }
.fade-in-delay-4 { animation: fadeIn var(--transition-normal) 400ms forwards; }

/* ===== SLIDE IN ANIMATIONS ===== */

/* Slide up from bottom */
@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up-in {
    animation: slideUpIn var(--transition-normal) forwards;
}

/* Slide left from right */
@keyframes slideLeftIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-left-in {
    animation: slideLeftIn var(--transition-normal) forwards;
}

/* Slide right from left */
@keyframes slideRightIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-right-in {
    animation: slideRightIn var(--transition-normal) forwards;
}

/* ===== SCALE & ZOOM ANIMATIONS ===== */

/* Scale up entrance */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn var(--transition-normal) forwards;
}

/* Hover scale effect */
@keyframes scaleHover {
    to {
        transform: scale(1.05);
    }
}

.hover-scale {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), filter 300ms ease-out;
}

.hover-scale:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-hover);
    filter: brightness(1.02);
}

/* ===== BOUNCE & LIFT ANIMATIONS ===== */

/* Lift card on hover */
@keyframes liftUp {
    to {
        transform: translateY(-8px);
        box-shadow: var(--shadow-hover);
    }
}

.card-lift {
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-light);
}

.card-lift:hover {
    animation: liftUp var(--transition-normal) forwards;
}

/* ===== PULSE ANIMATIONS ===== */

/* Subtle pulse effect */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== COUNTER ANIMATIONS ===== */

/* Counter number animation */
@keyframes counterPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.counter-number {
    animation: counterPulse 800ms ease-out;
}

/* ===== TEXT ANIMATIONS ===== */

/* Text slide animation (for lines) */
@keyframes textSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-animate {
    animation: textSlideUp var(--transition-normal) forwards;
}

/* Stagger text lines */
.text-animate-line-1 { animation: textSlideUp var(--transition-normal) 100ms forwards; }
.text-animate-line-2 { animation: textSlideUp var(--transition-normal) 200ms forwards; }
.text-animate-line-3 { animation: textSlideUp var(--transition-normal) 300ms forwards; }

/* ===== PARALLAX EFFECT ===== */

/* Parallax background - CSS only */
@keyframes parallaxMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 100px;
    }
}

.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Hero parallax effect - will be enhanced with JS */
.hero-parallax {
    position: relative;
    overflow: hidden;
}

.hero-parallax::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-parallax-content {
    position: relative;
    z-index: 2;
}

/* ===== BUTTON ANIMATIONS ===== */

/* Button hover effect */
@keyframes buttonHover {
    to {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(31, 71, 136, 0.3);
    }
}

.btn {
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(31, 71, 136, 0.2);
}

.btn:hover {
    animation: buttonHover var(--transition-fast) forwards;
}

/* Button ripple effect */
.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 600ms ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ===== INPUT & FORM ANIMATIONS ===== */

/* Input focus animation */
@keyframes inputFocus {
    from {
        box-shadow: inset 0 0 0 1px #ccc;
    }
    to {
        box-shadow: inset 0 0 0 2px var(--primary-blue);
        background-color: rgba(31, 71, 136, 0.02);
    }
}

input:focus,
textarea:focus,
select:focus {
    animation: inputFocus var(--transition-fast) forwards;
    outline: none;
}

/* Form field label animation */
@keyframes labelFloat {
    from {
        transform: translateY(0);
        opacity: 0.7;
    }
    to {
        transform: translateY(-20px);
        opacity: 1;
    }
}

.form-group.focused label {
    animation: labelFloat var(--transition-fast) forwards;
}

/* ===== LOADING ANIMATIONS ===== */

/* Spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Skeleton loading animation */
@keyframes skeletonLoading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeletonLoading 2s infinite;
}

/* ===== MODAL ANIMATIONS ===== */

/* Modal fade in */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    animation: modalFadeIn var(--transition-normal) forwards;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Modal slide up */
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    animation: modalSlideUp var(--transition-normal) forwards;
}

/* ===== NOTIFICATION ANIMATIONS ===== */

/* Toast notification slide in */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(300px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-notification {
    animation: toastSlideIn var(--transition-normal) forwards;
}

/* Toast notification slide out */
@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(300px);
    }
}

.toast-notification.hide {
    animation: toastSlideOut var(--transition-normal) forwards;
}

/* ===== SUCCESS CHECKMARK ANIMATION ===== */

@keyframes checkmarkDraw {
    0% {
        stroke-dashoffset: 48;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark-svg {
    animation: checkmarkDraw 400ms ease-out forwards;
}

/* ===== SMOOTH TRANSITIONS ===== */

/* Smooth transition utility */
.smooth-transition {
    transition: all var(--transition-normal);
}

.smooth-transition-fast {
    transition: all var(--transition-fast);
}

.smooth-transition-slow {
    transition: all var(--transition-slow);
}

/* ===== SCROLL PROGRESS ANIMATION ===== */

@keyframes progressFill {
    to {
        width: 100%;
    }
}

.progress-bar {
    animation: progressFill 0.5s ease-out forwards;
}

/* ===== HERO SECTION STAGGER ANIMATIONS ===== */

.hero-title {
    animation: slideUpIn var(--transition-slow) forwards;
}

.hero-subtitle {
    animation: slideUpIn var(--transition-slow) 200ms forwards;
}

.hero-cta {
    animation: slideUpIn var(--transition-slow) 400ms forwards;
}

/* ===== GRID STAGGER ANIMATIONS ===== */

.grid-item {
    animation: scaleIn var(--transition-normal) both;
}

.grid-item:nth-child(1) { animation-delay: 0ms; }
.grid-item:nth-child(2) { animation-delay: 50ms; }
.grid-item:nth-child(3) { animation-delay: 100ms; }
.grid-item:nth-child(4) { animation-delay: 150ms; }
.grid-item:nth-child(5) { animation-delay: 200ms; }
.grid-item:nth-child(6) { animation-delay: 250ms; }

/* ===== UTILITIES ===== */

/* No animation for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Opacity utilities */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Transform utilities */
.translate-y-4 { transform: translateY(4px); }
.translate-y-8 { transform: translateY(8px); }
.scale-105 { transform: scale(1.05); }

/* Animation delay utilities */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

