@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============================================
   CUSTOM ANIMATIONS - MHEC Hotel
   ============================================ */

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

    * {
        @apply transition-colors duration-200;
    }
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@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 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 zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

@layer utilities {

    /* Animation Classes */
    .animate-fade-in {
        animation: fadeIn 0.6s ease-out;
    }

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

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

    .animate-slide-in-left {
        animation: slideInLeft 0.8s ease-out;
    }

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

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

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

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

    /* Hover Effects */
    .hover-lift {
        @apply transition-all duration-300 ease-out;
    }

    .hover-lift:hover {
        @apply -translate-y-2 shadow-2xl;
    }

    .hover-scale {
        @apply transition-transform duration-300 ease-out;
    }

    .hover-scale:hover {
        @apply scale-105;
    }

    .hover-glow {
        @apply transition-all duration-300;
    }

    .hover-glow:hover {
        @apply shadow-lg shadow-theme-gold/50;
    }

    /* Image Zoom Effect */
    .image-zoom-container {
        @apply overflow-hidden;
    }

    .image-zoom {
        @apply transition-transform duration-700 ease-out;
    }

    .image-zoom-container:hover .image-zoom {
        @apply scale-110;
    }

    /* Gradient Animation */
    .gradient-animate {
        background-size: 200% 200%;
        animation: gradientShift 3s ease infinite;
    }

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

        50% {
            background-position: 100% 50%;
        }

        100% {
            background-position: 0% 50%;
        }
    }

    /* Loading Shimmer */
    .shimmer {
        background: linear-gradient(90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.2) 50%,
                rgba(255, 255, 255, 0) 100%);
        background-size: 1000px 100%;
        animation: shimmer 2s infinite;
    }

    /* Smooth Transitions */
    .transition-smooth {
        @apply transition-all duration-300 ease-in-out;
    }

    .transition-slow {
        @apply transition-all duration-500 ease-in-out;
    }

    .transition-fast {
        @apply transition-all duration-150 ease-in-out;
    }
}

/* ============================================
   COMPONENT ANIMATIONS
   ============================================ */

@layer components {

    /* Button Animations */
    .btn-animated {
        @apply relative overflow-hidden transition-all duration-300;
    }

    .btn-animated::before {
        content: '';
        @apply absolute inset-0 bg-white/20 transform -translate-x-full transition-transform duration-300;
    }

    .btn-animated:hover::before {
        @apply translate-x-0;
    }

    /* Card Hover Effect */
    .card-hover {
        @apply transition-all duration-300 ease-out;
    }

    .card-hover:hover {
        @apply -translate-y-2 shadow-2xl;
    }

    .card-hover:hover .card-image {
        @apply scale-110;
    }

    /* Input Focus Animation */
    .input-animated {
        @apply transition-all duration-200;
    }

    .input-animated:focus {
        @apply ring-2 ring-theme-gold ring-offset-2 transform scale-[1.02];
    }

    /* Loading Spinner */
    .spinner {
        @apply inline-block w-8 h-8 border-4 border-gray-200 border-t-theme-gold rounded-full;
        animation: spin 1s linear infinite;
    }

    /* Skeleton Loading */
    .skeleton {
        @apply bg-gray-200 rounded animate-pulse;
    }

    /* Stagger Animation for Lists */
    .stagger-item {
        opacity: 0;
        animation: fadeInUp 0.6s ease-out forwards;
    }

    .stagger-item:nth-child(1) {
        animation-delay: 0.1s;
    }

    .stagger-item:nth-child(2) {
        animation-delay: 0.2s;
    }

    .stagger-item:nth-child(3) {
        animation-delay: 0.3s;
    }

    .stagger-item:nth-child(4) {
        animation-delay: 0.4s;
    }

    .stagger-item:nth-child(5) {
        animation-delay: 0.5s;
    }

    .stagger-item:nth-child(6) {
        animation-delay: 0.6s;
    }

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

    /* Glass Morphism Effect */
    .glass {
        @apply bg-white/10 backdrop-blur-lg border border-white/20;
    }

    /* Text Gradient Animation */
    .text-gradient-animate {
        @apply bg-clip-text text-transparent;
        background-image: linear-gradient(90deg, #D4AF37, #FFD700, #D4AF37);
        background-size: 200% auto;
        animation: gradientShift 3s linear infinite;
    }
}

/* ============================================
   PAGE TRANSITION
   ============================================ */

.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s, transform 0.3s;
}

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

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   ADDITIONAL ANIMATIONS
   ============================================ */

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@layer utilities {
    .animate-shake {
        animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
    }

    .animate-slide-down {
        animation: slideDown 0.4s ease-out forwards;
    }

    .animate-bounce-slow {
        animation: bounce 3s infinite;
    }
}