/* Animations and Transitions */

/* Keyframe Animations */
@keyframes fadeInUp {
    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 fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

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

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

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.8s ease forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.8s ease forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.8s ease forwards;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

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

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

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

.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-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* Loading Animations */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

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

/* Stagger Animations */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.stagger-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }

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

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.6s ease;
}

.text-reveal.animate span {
    transform: translateY(0);
}

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

.image-reveal img {
    transform: scale(1.1);
    transition: transform 0.8s ease;
}

.image-reveal.animate img {
    transform: scale(1);
}

/* Button Animations */
.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::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;
}

.btn-animate:hover::before {
    left: 100%;
}

/* Navigation Animations */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: left 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
    left: 0;
}

/* Card Animations */
.card-hover {
    transition: all 0.3s ease;
    position: relative;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card-hover:hover::before {
    opacity: 0.1;
}

/* Menu Item Animations */
.menu-item {
    transition: all 0.3s ease;
    position: relative;
}

.menu-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu-item:hover::after {
    width: 100%;
}

/* Gallery Animations */
.gallery-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(212, 175, 55, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item img {
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Form Animations */
.form-input {
    transition: all 0.3s ease;
    position: relative;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* Success/Error Animations */
.success-animation {
    animation: successPulse 0.6s ease;
}

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

.error-shake {
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Page Transition Animations */
.page-transition {
    animation: pageFadeIn 0.5s ease;
}

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

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Animations */
@media (max-width: 768px) {
    .parallax {
        background-attachment: scroll;
    }
    
    .animate-float {
        animation: none;
    }
    
    .stagger-item {
        transition-delay: 0.1s !important;
    }
    
    /* Reduce animation intensity on mobile */
    .hover-lift:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .hover-scale:hover {
        transform: scale(1.02);
    }
    
    .hover-rotate:hover {
        transform: rotate(2deg);
    }
    
    /* Optimize gallery animations for mobile */
    .gallery-item:hover img {
        transform: scale(1.05);
    }
    
    /* Reduce form animation intensity */
    .form-input:focus {
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(212, 175, 55, 0.2);
    }
    
    /* Optimize button animations */
    .btn-animate::before {
        transition: left 0.3s ease;
    }
    
    /* Reduce text animation delays */
    .text-reveal span {
        transition: transform 0.4s ease;
    }
    
    /* Optimize image reveal animations */
    .image-reveal img {
        transition: transform 0.5s ease;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Moderate animation intensity for tablets */
    .hover-lift:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    }
    
    .hover-scale:hover {
        transform: scale(1.03);
    }
    
    .hover-rotate:hover {
        transform: rotate(3deg);
    }
    
    /* Optimize stagger delays for tablets */
    .stagger-item:nth-child(1) { transition-delay: 0.05s; }
    .stagger-item:nth-child(2) { transition-delay: 0.1s; }
    .stagger-item:nth-child(3) { transition-delay: 0.15s; }
    .stagger-item:nth-child(4) { transition-delay: 0.2s; }
    .stagger-item:nth-child(5) { transition-delay: 0.25s; }
    .stagger-item:nth-child(6) { transition-delay: 0.3s; }
}

/* Large mobile devices (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    /* Slightly more animation for larger mobile screens */
    .hover-lift:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    }
    
    .gallery-item:hover img {
        transform: scale(1.08);
    }
    
    .form-input:focus {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-rotate:hover,
    .hover-glow:hover {
        transform: none;
        box-shadow: none;
    }
    
    .gallery-item:hover::before,
    .gallery-item:hover img {
        opacity: 1;
        transform: none;
    }
    
    .card-hover:hover::before {
        opacity: 0;
    }
    
    .menu-item:hover::after {
        width: 0;
    }
    
    .nav-link:hover::before,
    .nav-link.active::before {
        left: -100%;
    }
    
    /* Add touch-friendly active states */
    .hover-lift:active {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .hover-scale:active {
        transform: scale(1.02);
    }
    
    .btn-animate:active::before {
        left: 100%;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 1024px) {
    /* Use transform3d for hardware acceleration */
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-slide-in-up,
    .animate-slide-in-down,
    .animate-zoom-in {
        will-change: transform, opacity;
    }
    
    /* Optimize transitions for mobile */
    .hover-lift,
    .hover-scale,
    .hover-rotate,
    .hover-glow,
    .card-hover,
    .menu-item,
    .gallery-item,
    .form-input {
        will-change: auto;
    }
    
    /* Reduce animation complexity on mobile */
    .animate-bounce,
    .animate-pulse,
    .animate-float {
        animation-duration: 1.5s;
    }
    
    /* Optimize loading animations */
    .loading::before {
        animation-duration: 1s;
    }
    
    /* Reduce shimmer animation intensity */
    .btn-animate::before {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }
}

/* Landscape mobile optimizations */
@media (max-width: 767px) and (orientation: landscape) {
    /* Reduce animation intensity in landscape */
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-slide-in-up,
    .animate-slide-in-down {
        animation-duration: 0.5s;
    }
    
    .stagger-item {
        transition-delay: 0.05s !important;
    }
    
    /* Disable float animation in landscape */
    .animate-float {
        animation: none;
    }
}

/* High refresh rate displays */
@media (min-resolution: 120dpi) {
    /* Optimize animations for high refresh rate displays */
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-slide-in-up,
    .animate-slide-in-down,
    .animate-zoom-in {
        animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .hover-lift,
    .hover-scale,
    .hover-rotate,
    .hover-glow {
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* 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;
    }
    
    .parallax {
        background-attachment: scroll;
    }
} 