/**
 * Custom Animation Effects for 대리석 수리 Website
 * Using antigravity-inspired floating and smooth effects
 */

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Float Animation - Antigravity Effect */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

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

/* Count Up Animation Base */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
}

/* Hero Section Animation */
.hero-section .wp-block-cover__inner-container {
    animation: fadeInUp 1s ease-out;
}

.hero-section h1 {
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-section p {
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.hero-section .wp-block-buttons {
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

/* Service Cards Animation */
.wp-block-columns .wp-block-column {
    animation: fadeInUp 0.8s ease-out backwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-columns .wp-block-column:nth-child(1) {
    animation-delay: 0.1s;
}

.wp-block-columns .wp-block-column:nth-child(2) {
    animation-delay: 0.2s;
}

.wp-block-columns .wp-block-column:nth-child(3) {
    animation-delay: 0.3s;
}

.wp-block-columns .wp-block-column:nth-child(4) {
    animation-delay: 0.4s;
}

/* Card Hover Effects */
.wp-block-column.has-accent-6-background-color:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Statistics Section - Floating Numbers */
.wp-block-columns .wp-block-column h3.has-accent-1-color {
    animation: float 3s ease-in-out infinite;
}

.wp-block-columns .wp-block-column:nth-child(1) h3 {
    animation-delay: 0s;
}

.wp-block-columns .wp-block-column:nth-child(2) h3 {
    animation-delay: 0.5s;
}

.wp-block-columns .wp-block-column:nth-child(3) h3 {
    animation-delay: 1s;
}

.wp-block-columns .wp-block-column:nth-child(4) h3 {
    animation-delay: 1.5s;
}

/* Button Animations */
.wp-block-button__link {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wp-block-button__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.wp-block-button__link:active {
    transform: translateY(-1px);
}

/* Gallery Image Animation */
.wp-block-gallery .wp-block-image {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.wp-block-gallery .wp-block-image:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Section Headings Animation */
h2.wp-block-heading {
    position: relative;
}

h2.wp-block-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #333, #666);
    margin: 15px auto 0;
    border-radius: 2px;
    animation: slideInLeft 0.8s ease-out;
}

/* Cover Section Parallax-like Effect */
.wp-block-cover {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .wp-block-cover {
        background-attachment: scroll;
    }
}

/* GIF Image Floating Effect */
figure#button1 img,
.wp-block-image img[src*="gif"] {
    animation: float 4s ease-in-out infinite;
    border-radius: 12px;
}

/* Service Region Cards */
.has-accent-3-border-color {
    transition: all 0.3s ease;
}

.has-accent-3-border-color:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #333 !important;
}

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

/* Loading Animation for Images */
.wp-block-image img {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.wp-block-image img[loading="lazy"] {
    opacity: 1;
}

/* Phone Number Highlight */
a[href^="tel:"] {
    position: relative;
}

a[href^="tel:"]::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

a[href^="tel:"]:hover::before {
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem !important;
    }

    .wp-block-columns .wp-block-column {
        animation-delay: 0s !important;
    }

    h3.has-accent-1-color {
        font-size: 2.5rem !important;
    }
}

/* Intersection Observer Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Shine Effect for Buttons */
.wp-block-button__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.wp-block-button__link:hover::before {
    left: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
