/**
 * PECTU Website Animations
 * Comprehensive animation system for cards, buttons, texts, and interactive elements
 */

/* ============================================
   BASE ANIMATION CLASSES
   ============================================ */

/* Fade In Animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
    opacity: 0;
}

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

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

/* Slide Up Animation */
.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Scale Animations */
.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
    opacity: 0;
    transform: scale(0.8);
}

.animate-scale-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.animate-scale-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Bounce Animations */
.animate-bounce-subtle {
    animation: bounceSubtle 2s ease-in-out infinite;
}

.animate-bounce-hover:hover {
    animation: bounce 0.5s ease;
}

/* Pulse Animation */
.animate-pulse-custom {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Shine Effect */
.animate-shine {
    position: relative;
    overflow: hidden;
}

.animate-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 2s infinite;
}

/* ============================================
   KEYFRAME DEFINITIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeInDown {
    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 slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

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

@keyframes wobble {
    0%, 100% {
        transform: rotate(0);
    }
    25% {
        transform: rotate(-3deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: currentColor;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes blob {
    0% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

/* Card Hover Lift */
.card-hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Card Border Glow */
.card-border-glow {
    position: relative;
    overflow: hidden;
}

.card-border-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #F8A22F, #07195C, #F8A22F);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-border-glow:hover::before {
    opacity: 1;
}

/* Card Icon Pop */
.card-icon-pop {
    transition: all 0.3s ease;
}

.card-icon-pop:hover {
    transform: scale(1.2) rotate(5deg);
}

/* Card Content Fade */
.card-content-fade {
    transition: all 0.3s ease;
}

.card-content-fade:hover {
    background-color: rgba(7, 25, 92, 0.05);
}

/* Staggered Card Animation */
.stagger-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-card:nth-child(1) { animation-delay: 0.1s; }
.stagger-card:nth-child(2) { animation-delay: 0.2s; }
.stagger-card:nth-child(3) { animation-delay: 0.3s; }
.stagger-card:nth-child(4) { animation-delay: 0.4s; }
.stagger-card:nth-child(5) { animation-delay: 0.5s; }
.stagger-card:nth-child(6) { animation-delay: 0.6s; }
.stagger-card:nth-child(7) { animation-delay: 0.7s; }
.stagger-card:nth-child(8) { animation-delay: 0.8s; }

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

/* Button Hover Fill */
.btn-hover-fill {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-hover-fill::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
}

.btn-hover-fill:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Button Scale */
.btn-scale {
    transition: all 0.2s ease;
}

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

.btn-scale:active {
    transform: scale(0.98);
}

/* Button Arrow Move */
.btn-arrow-move {
    transition: all 0.3s ease;
}

.btn-arrow-move:hover {
    padding-right: 1.5rem;
}

.btn-arrow-move:hover i,
.btn-arrow-move:hover span {
    transform: translateX(5px);
}

/* Button Glow */
.btn-glow {
    position: relative;
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(248, 162, 47, 0.5);
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #F8A22F 0%, #07195C 50%, #F8A22F 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* Text Underline Animation */
.text-underline {
    position: relative;
    display: inline-block;
}

.text-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

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

/* Text Reveal */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: slideUp 0.5s ease forwards;
}

/* Heading Underline */
.heading-underline {
    position: relative;
    display: inline-block;
}

.heading-underline::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #F8A22F, #07195C);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.heading-underline:hover::after {
    width: 100px;
}

/* ============================================
   NAVIGATION ANIMATIONS
   ============================================ */

/* Nav Link Underline */
.nav-link-underline {
    position: relative;
}

.nav-link-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #F8A22F;
    transition: width 0.3s ease;
}

.nav-link-underline:hover::after,
.nav-link-underline.active::after {
    width: 100%;
}

/* Nav Item Hover */
.nav-item-hover {
    transition: all 0.3s ease;
}

.nav-item-hover:hover {
    transform: translateY(-2px);
}

/* Mobile Menu Slide */
.mobile-menu-slide {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   STATS COUNTER ANIMATIONS
   ============================================ */

.stat-counter {
    font-variant-numeric: tabular-nums;
}

.stat-number {
    display: inline-block;
}

/* ============================================
   IMAGE ANIMATIONS
   ============================================ */

/* Image Zoom */
.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.5s ease;
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* Image Tilt */
.image-tilt {
    perspective: 1000px;
    overflow: hidden;
}

.image-tilt img {
    transition: transform 0.3s ease;
}

.image-tilt:hover img {
    transform: rotateY(5deg) rotateX(5deg);
}

/* Image Reveal */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    animation: imageShine 2s infinite;
}

@keyframes imageShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   FORM ANIMATIONS
   ============================================ */

/* Input Focus */
.input-focus {
    transition: all 0.3s ease;
}

.input-focus:focus {
    box-shadow: 0 0 0 3px rgba(248, 162, 47, 0.2);
    border-color: #F8A22F;
}

/* Input Label Float */
.input-group {
    position: relative;
}

.input-field {
    transition: all 0.3s ease;
}

.input-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-field:focus ~ .input-label,
.input-field:not(:placeholder-shown) ~ .input-label {
    top: 0;
    left: 0.5rem;
    font-size: 0.75rem;
    color: #F8A22F;
    background: white;
    padding: 0 0.5rem;
}

/* Checkbox Animation */
.checkbox-animate {
    transition: all 0.2s ease;
}

.checkbox-animate:checked {
    background-color: #F8A22F;
    border-color: #F8A22F;
}

/* Radio Button Animation */
.radio-animate {
    transition: all 0.2s ease;
}

.radio-animate:checked {
    border-color: #F8A22F;
    box-shadow: 0 0 0 3px rgba(248, 162, 47, 0.2);
}

/* ============================================
   TABLE ANIMATIONS
   ============================================ */

/* Table Row Hover */
.table-row-hover {
    transition: all 0.2s ease;
}

.table-row-hover:hover {
    background-color: rgba(248, 162, 47, 0.05);
    transform: translateX(4px);
}

/* Table Row Stagger */
.table-row-stagger {
    opacity: 0;
    animation: fadeInLeft 0.4s ease-out forwards;
}

.table-row-stagger:nth-child(1) { animation-delay: 0.05s; }
.table-row-stagger:nth-child(2) { animation-delay: 0.1s; }
.table-row-stagger:nth-child(3) { animation-delay: 0.15s; }
.table-row-stagger:nth-child(4) { animation-delay: 0.2s; }
.table-row-stagger:nth-child(5) { animation-delay: 0.25s; }
.table-row-stagger:nth-child(6) { animation-delay: 0.3s; }
.table-row-stagger:nth-child(7) { animation-delay: 0.35s; }
.table-row-stagger:nth-child(8) { animation-delay: 0.4s; }

/* ============================================
   BADGE ANIMATIONS
   ============================================ */

/* Badge Pulse */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

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

/* Badge Float */
.badge-float {
    animation: badgeFloat 3s ease-in-out infinite;
}

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

/* ============================================
   ICON ANIMATIONS
   ============================================ */

/* Icon Spin */
.icon-spin {
    transition: transform 0.3s ease;
}

.icon-spin:hover {
    transform: rotate(180deg);
}

/* Icon Bounce */
.icon-bounce {
    transition: all 0.3s ease;
}

.icon-bounce:hover {
    animation: bounce 0.5s ease;
}

/* Icon Pulse */
.icon-pulse {
    transition: all 0.3s ease;
}

.icon-pulse:hover {
    animation: pulse 1s ease infinite;
}

/* ============================================
   PROGRESS BAR ANIMATIONS
   ============================================ */

/* Progress Bar Fill */
.progress-fill {
    animation: progressGrow 1.5s ease-out forwards;
}

@keyframes progressGrow {
    from {
        width: 0;
    }
}

/* Progress Bar Stripes */
.progress-stripes {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

/* ============================================
   MODAL/DROPDOWN ANIMATIONS
   ============================================ */

/* Modal Fade In */
.modal-fade-in {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dropdown Slide */
.dropdown-slide {
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(248, 162, 47, 0.1);
    border-radius: 50%;
    border-top: 3px solid #F8A22F;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Dots */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background-color: #F8A22F;
    border-radius: 50%;
    animation: dotsBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dotsBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Loading Bar */
.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(248, 162, 47, 0.2);
    overflow: hidden;
}

.loading-bar::after {
    content: '';
    display: block;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, #F8A22F, #07195C, #F8A22F);
    animation: loadingMove 1.5s ease-in-out infinite;
    background-size: 200% 100%;
}

@keyframes loadingMove {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

/* Scroll Reveal Base */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Reveal Left */
.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scroll Reveal Right */
.scroll-reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scroll Reveal Scale */
.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */

/* Float Animation */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Blur In */
.animate-blur-in {
    animation: blurIn 0.6s ease-out forwards;
    filter: blur(10px);
}

@keyframes blurIn {
    to {
        filter: blur(0);
    }
}

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

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

/* Parallax Base */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation-duration: 0.4s;
    }
    
    .card-hover-lift:hover {
        transform: translateY(-4px);
    }
    
    .stagger-card:nth-child(n) {
        animation-delay: 0.1s;
    }
}

/* ============================================
   HERO SECTION ANIMATIONS
   ============================================ */

/* Hero Text Reveal */
.hero-text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: heroTextReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-text-reveal .word-1 { animation-delay: 0.2s; }
.hero-text-reveal .word-2 { animation-delay: 0.4s; }
.hero-text-reveal .word-3 { animation-delay: 0.6s; }
.hero-text-reveal .word-4 { animation-delay: 0.8s; }
.hero-text-reveal .word-5 { animation-delay: 1s; }

@keyframes heroTextReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Button Stagger */
.hero-btn-stagger {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.hero-btn-stagger:nth-child(1) { animation-delay: 0.8s; }
.hero-btn-stagger:nth-child(2) { animation-delay: 1s; }

/* Hero Image Reveal */
.hero-image-reveal {
    animation: heroImageReveal 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: scale(1.1);
}

@keyframes heroImageReveal {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Background Parallax */
.bg-parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ============================================
   FOOTER ANIMATIONS
   ============================================ */

/* Footer Link Hover */
.footer-link-hover {
    position: relative;
    padding-left: 1.25rem;
    transition: all 0.3s ease;
}

.footer-link-hover::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.footer-link-hover:hover {
    padding-left: 1.5rem;
}

.footer-link-hover:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Social Icon Hover */
.social-icon-hover {
    transition: all 0.3s ease;
}

.social-icon-hover:hover {
    transform: translateY(-5px) scale(1.1);
}

/* ============================================
   SECTION DIVIDER ANIMATIONS
   ============================================ */

/* Section Divider Wave */
.wave-divider {
    overflow: hidden;
    line-height: 0;
}

.wave-divider svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

/* Curved Divider Animation */
.curved-divider {
    animation: curveWave 8s ease-in-out infinite alternate;
}

@keyframes curveWave {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50px);
    }
}

