/* Fade Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

/* Scale Animations */
.scale-in {
    animation: scaleIn 0.5s ease-out;
}

.zoom-in {
    animation: zoomIn 0.6s ease-out;
}

/* Rotate Animations */
.rotate-in {
    animation: rotateIn 0.6s ease-out;
}

/* Slide Animations */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

/* Bounce Animations */
.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

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

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

/* Keyframes */
@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Parallax Effect Classes */
.parallax {
    position: relative;
    transform: translateZ(0);
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    will-change: transform;
}

/* Scroll Triggered Animations */
[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
    transition-duration: 0.8s;
}

[data-aos="fade-up"] {
    transform: translateY(50px);
}

[data-aos="fade-down"] {
    transform: translateY(-50px);
}

[data-aos="fade-left"] {
    transform: translateX(50px);
}

[data-aos="fade-right"] {
    transform: translateX(-50px);
}

[data-aos="zoom-in"] {
    transform: scale(0.6);
}

[data-aos="zoom-out"] {
    transform: scale(1.2);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.hover-grow {
    transition: transform 0.3s ease;
}

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

.hover-shrink {
    transition: transform 0.3s ease;
}

.hover-shrink:hover {
    transform: scale(0.95);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Text Animations */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-rice);
    animation: reveal 1s ease-out forwards;
}

@keyframes reveal {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Loading Animations */
.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-orange);
    margin: 0 3px;
    animation: loading-dots 1.4s ease-in-out infinite;
}

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

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

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

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    40% {
        transform: scale(1.3);
        opacity: 0.5;
    }
}

/* Japanese Calligraphy Brush Stroke Effect */
.brush-stroke {
    position: relative;
    display: inline-block;
}

.brush-stroke::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: -10px;
    right: -10px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M0 10Q25 0 50 10T100 10" stroke="%23CC4125" stroke-width="3" fill="none" opacity="0.3"/></svg>') no-repeat center;
    background-size: 100% 100%;
    animation: brushDraw 2s ease-out forwards;
}

@keyframes brushDraw {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* Katana Slash Effect */
.katana-slash {
    position: relative;
    overflow: hidden;
}

.katana-slash::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-orange) 50%, 
        transparent 100%);
    animation: slash 0.5s ease-out forwards;
}

@keyframes slash {
    to {
        left: 100%;
    }
}

/* Cherry Blossom Fall Animation */
.sakura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.sakura-petal {
    position: absolute;
    background: var(--accent-orange);
    width: 10px;
    height: 10px;
    border-radius: 0 100% 0 100%;
    opacity: 0.8;
    animation: sakuraFall linear infinite;
}

@keyframes sakuraFall {
    from {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0.8;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.8;
    }
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    [data-aos] {
        transition-duration: 0.5s;
    }
    
    [data-aos="fade-up"],
    [data-aos="fade-down"] {
        transform: translateY(30px);
    }
    
    [data-aos="fade-left"],
    [data-aos="fade-right"] {
        transform: translateX(30px);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        animation-delay: 0.01ms !important;
    }
    
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}