/**
 * =============================================
 * KOWSKI CONSTRUCTION - ANIMATIONS STYLESHEET
 * All animations, transitions, and effects
 * Version 2.0 - Optimized & Consolidated
 * =============================================
 */

/* =============================================
   FADE ANIMATIONS
   ============================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Fade Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

/* Staggered fade-in for multiple elements */
.fade-in-stagger:nth-child(1) { animation-delay: 0.1s; }
.fade-in-stagger:nth-child(2) { animation-delay: 0.2s; }
.fade-in-stagger:nth-child(3) { animation-delay: 0.3s; }
.fade-in-stagger:nth-child(4) { animation-delay: 0.4s; }
.fade-in-stagger:nth-child(5) { animation-delay: 0.5s; }
.fade-in-stagger:nth-child(6) { animation-delay: 0.6s; }

/* =============================================
   SLIDE ANIMATIONS
   ============================================= */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutToTop {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100px);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide Animation Classes */
.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.slide-down {
    animation: slideDown 0.5s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

/* =============================================
   SCALE & ZOOM ANIMATIONS
   ============================================= */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomFade {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scale Animation Classes */
.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.zoom-in {
    animation: zoomIn 0.5s ease-out forwards;
}

/* =============================================
   PULSE & BOUNCE ANIMATIONS
   ============================================= */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(0.9);
    }
    20%, 40%, 60%, 80% {
        transform: scale(1.1);
    }
    50%, 70% {
        transform: scale(1.05);
    }
}

/* Pulse & Bounce Classes */
.pulse {
    animation: pulse 2s infinite;
}

.bounce {
    animation: bounce 2s infinite;
}

.heartbeat {
    animation: heartbeat 1.5s infinite;
}

/* =============================================
   LOADING ANIMATIONS
   ============================================= */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Spinner */
.spinner {
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #2c5f2d;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border-width: 5px;
}

.loading-text::after {
    content: '.';
    animation: dots 1.5s infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* =============================================
   SHAKE & WIGGLE ANIMATIONS
   ============================================= */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(15deg);
    }
    75% {
        transform: rotate(-15deg);
    }
}

/* Shake & Wiggle Classes */
.shake {
    animation: shake 0.5s;
}

.wiggle {
    animation: wiggle 0.5s;
}

.swing {
    animation: swing 2s ease-in-out infinite;
}

/* =============================================
   GLOW & SHADOW EFFECTS
   ============================================= */

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(44, 95, 45, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(44, 95, 45, 0.8), 0 0 30px rgba(44, 95, 45, 0.6);
    }
}

@keyframes shadowPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255,107,53,0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(255,107,53,0.8), 0 0 30px rgba(255,107,53,0.6);
    }
}

/* Glow Classes */
.glow {
    animation: glow 2s ease-in-out infinite;
}

.shadow-pulse {
    animation: shadowPulse 2s ease-in-out infinite;
}

.text-glow {
    animation: textGlow 2s ease-in-out infinite;
}

/* =============================================
   HOVER EFFECTS
   ============================================= */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(44, 95, 45, 0.4);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-brightness {
    transition: filter 0.3s ease;
}

.hover-brightness:hover {
    filter: brightness(1.1);
}

/* =============================================
   TEXT ANIMATIONS
   ============================================= */

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #2c5f2d;
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both,
               blink 0.75s step-end infinite;
}

/* =============================================
   GRADIENT ANIMATIONS
   ============================================= */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes backgroundPan {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 100% center;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

.bg-pan {
    animation: backgroundPan 20s linear infinite alternate;
}

/* =============================================
   ICON ANIMATIONS
   ============================================= */

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes tada {
    0% {
        transform: scale(1) rotate(0);
    }
    10%, 20% {
        transform: scale(0.9) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.1) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

.tada {
    animation: tada 1s ease;
}

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */

@keyframes scrollDown {
    0% {
        opacity: 0;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

.scroll-indicator {
    animation: scrollDown 2s infinite;
}

/* =============================================
   BADGE ANIMATIONS
   ============================================= */

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes badgeBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

@keyframes badgeGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255,107,53,0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255,107,53,0);
    }
}

.badge-pop {
    animation: badgePop 0.4s ease-out;
}

.badge-bounce {
    animation: badgeBounce 0.5s ease;
}

.badge-glow {
    animation: badgeGlow 1.5s infinite;
}

/* =============================================
   BUTTON ANIMATIONS
   ============================================= */

@keyframes buttonPress {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
}

.btn-press:active {
    animation: buttonPress 0.2s ease;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* =============================================
   CARD ANIMATIONS
   ============================================= */

@keyframes cardFlip {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(180deg);
    }
}

.card-flip {
    perspective: 1000px;
}

.card-flip:hover .card-inner {
    transform: rotateY(180deg);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* =============================================
   FLIP ANIMATIONS
   ============================================= */

@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

.flip-in {
    animation: flipIn 0.6s ease-out;
}

/* =============================================
   REVEAL ANIMATIONS
   ============================================= */

@keyframes revealLeft {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes revealRight {
    from {
        clip-path: inset(0 0 0 100%);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal-left {
    animation: revealLeft 1s ease-out forwards;
}

.reveal-right {
    animation: revealRight 1s ease-out forwards;
}

/* =============================================
   GALLERY ANIMATIONS
   ============================================= */

.gallery-item {
    opacity: 0;
    animation: zoomFade 0.5s ease-out forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }

/* =============================================
   MODAL ANIMATIONS
   ============================================= */

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-backdrop {
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    animation: modalSlideDown 0.3s ease;
}

/* =============================================
   NOTIFICATION ANIMATIONS
   ============================================= */

.notification-enter {
    animation: slideInFromTop 0.5s ease-out forwards;
}

.notification-exit {
    animation: slideOutToTop 0.5s ease-out forwards;
}

/* =============================================
   FORM ANIMATIONS
   ============================================= */

@keyframes inputFocus {
    from {
        border-color: #ddd;
    }
    to {
        border-color: #2c5f2d;
    }
}

@keyframes successCheck {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

input:focus, 
textarea:focus, 
select:focus {
    animation: inputFocus 0.3s ease;
}

.success-check {
    animation: successCheck 0.6s ease-out;
}

/* =============================================
   PROGRESS BAR ANIMATIONS
   ============================================= */

@keyframes progressFill {
    from {
        width: 0%;
    }
}

.progress-bar-animated .progress-fill {
    animation: progressFill 1.5s ease-out forwards;
}

/* =============================================
   NUMBER COUNTER ANIMATIONS
   ============================================= */

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.6s ease-out;
}

/* =============================================
   UNDERLINE ANIMATIONS
   ============================================= */

.underline-animate {
    position: relative;
    display: inline-block;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #2c5f2d;
    transition: width 0.3s ease;
}

.underline-animate:hover::after {
    width: 100%;
}

/* =============================================
   PAGE TRANSITION ANIMATIONS
   ============================================= */

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-content {
    animation: pageLoad 0.5s ease-out;
}

/* =============================================
   PRELOADER ANIMATION
   ============================================= */

@keyframes preloaderSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.preloader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e8f5e9;
    border-top-color: #2c5f2d;
    border-radius: 50%;
    animation: preloaderSpin 1s linear infinite;
}

.preloader-fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

/* =============================================
   UTILITY ANIMATION CLASSES
   ============================================= */

/* Animation Delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* Animation Speeds */
.animate-fast { animation-duration: 0.3s !important; }
.animate-normal { animation-duration: 0.6s !important; }
.animate-slow { animation-duration: 1s !important; }
.animate-slower { animation-duration: 1.5s !important; }

/* Animation Control */
.animate-infinite {
    animation-iteration-count: infinite;
}

.animate-once {
    animation-iteration-count: 1;
}

.pause-on-hover:hover {
    animation-play-state: paused;
}

.animate-forwards {
    animation-fill-mode: forwards;
}

.animate-backwards {
    animation-fill-mode: backwards;
}

.animate-both {
    animation-fill-mode: both;
}

/* =============================================
   RESPONSIVE ANIMATION CONTROLS
   ============================================= */

/* Reduce motion for accessibility */
@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;
    }
    
    .scroll-indicator,
    .pulse,
    .bounce,
    .float,
    .swing,
    .heartbeat {
        animation: none !important;
    }
}

/* Disable heavy animations on mobile for performance */
@media (max-width: 768px) {
    .mobile-no-animate {
        animation: none !important;
    }
    
    /* Simplify complex animations on mobile */
    .gradient-animate,
    .bg-pan,
    .shimmer {
        animation-duration: 5s !important;
    }
    
    /* Reduce animation complexity */
    .card-flip:hover .card-inner {
        transform: none;
    }
}

/* Disable animations on low-end devices */
@media (max-width: 480px) {
    .gallery-item {
        opacity: 1 !important;
        animation: none !important;
    }
    
    .fade-in-stagger {
        animation-delay: 0s !important;
    }
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* =============================================
   END OF ANIMATIONS STYLESHEET
   ============================================= */