/* Animation Styles for Hotel Management System */

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

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

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

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

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

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

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

/* Slide Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

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

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

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

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

/* Glow Animation */
@keyframes glow {
    0% {
        box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    }
    100% {
        box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

/* Apply animations to elements */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

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

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

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

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

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

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

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

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

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

.animate-rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
}

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

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Page load animations */
.page-load .hero-title {
    animation: fadeInDown 1s ease-out 0.2s both;
}

.page-load .hero-subtitle {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.page-load .hero-search {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.page-load .section-title {
    animation: fadeInUp 0.8s ease-out both;
}

/* Room card animations */
.room-card {
    animation: fadeInUp 0.6s ease-out both;
}

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

/* Hall card animations */
.hall-card {
    animation: fadeInUp 0.6s ease-out both;
}

.hall-card:nth-child(1) { animation-delay: 0.1s; }
.hall-card:nth-child(2) { animation-delay: 0.2s; }
.hall-card:nth-child(3) { animation-delay: 0.3s; }

/* Review card animations */
.review-card {
    animation: fadeInLeft 0.6s ease-out both;
}

.review-card:nth-child(odd) {
    animation-name: fadeInLeft;
}

.review-card:nth-child(even) {
    animation-name: fadeInRight;
}

.review-card:nth-child(1) { animation-delay: 0.1s; }
.review-card:nth-child(2) { animation-delay: 0.2s; }
.review-card:nth-child(3) { animation-delay: 0.3s; }
.review-card:nth-child(4) { animation-delay: 0.4s; }

/* Facility animations */
.facility-item {
    animation: fadeInLeft 0.5s ease-out both;
}

.facility-item:nth-child(1) { animation-delay: 0.1s; }
.facility-item:nth-child(2) { animation-delay: 0.2s; }
.facility-item:nth-child(3) { animation-delay: 0.3s; }
.facility-item:nth-child(4) { animation-delay: 0.4s; }

/* Button hover animations */
.book-btn:hover:not(.disabled) {
    animation: pulse 0.5s ease-in-out;
}

.search-btn:hover {
    animation: scaleUp 0.3s ease-out forwards;
}

.review-btn:hover {
    animation: scaleUp 0.3s ease-out forwards;
}

.banner-btn:hover {
    animation: scaleUp 0.3s ease-out forwards;
}

/* Modal animations */
.modal.show .modal-content {
    animation: bounceIn 0.5s ease-out forwards;
}

.modal.hide .modal-content {
    animation: fadeInUp 0.3s ease-out reverse forwards;
}

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

.nav-link::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(29, 78, 216, 0.1));
    transition: top 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before {
    top: 0;
}

/* Image hover animations */
.room-image {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.room-card:hover .room-image.active {
    transform: scale(1.05);
}

.hall-image {
    transition: transform 0.5s ease;
}

.hall-card:hover .hall-image {
    transform: scale(1.05);
}

/* Rating bar animation */
.rating-fill {
    animation: fillBar 1s ease-out forwards;
}

@keyframes fillBar {
    from {
        width: 0;
    }
}

/* Star rating animations */
.star-rating i {
    transition: all 0.2s ease;
}

.star-rating:hover i {
    animation: pulse 0.5s ease-in-out;
}

/* Banner slide animations */
.banner-slide {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.banner-slide.active {
    animation: fadeIn 0.5s ease-out forwards;
}

.banner-content {
    animation: slideInUp 0.8s ease-out 0.3s both;
}

/* Contact item animations */
.contact-item {
    animation: fadeInUp 0.6s ease-out both;
}

.contact-item:nth-child(1) { animation-delay: 0.1s; }
.contact-item:nth-child(2) { animation-delay: 0.2s; }
.contact-item:nth-child(3) { animation-delay: 0.3s; }

/* Footer animation */
.footer-section {
    animation: fadeInUp 0.6s ease-out both;
}

.footer-section:nth-child(1) { animation-delay: 0.1s; }
.footer-section:nth-child(2) { animation-delay: 0.2s; }
.footer-section:nth-child(3) { animation-delay: 0.3s; }

/* Form animations */
.form-group {
    animation: fadeInUp 0.4s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

/* Loading state animations */
.loading-shimmer {
    background: linear-gradient(to right, #f6f7f8 0%, #eee 50%, #f6f7f8 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* Error/Success message animations */
.alert {
    animation: slideInDown 0.3s ease-out forwards;
}

.alert.show {
    animation: slideInDown 0.3s ease-out forwards;
}

.alert.hide {
    animation: slideInUp 0.3s ease-out forwards;
}

/* Progress bar animation */
@keyframes progress {
    from {
        width: 0;
    }
}

.progress-bar {
    animation: progress 1s ease-out forwards;
}

/* Typing animation for text */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typing-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #2563eb;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #2563eb;
    }
}

/* Scroll reveal animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

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

/* Mobile-specific animations */
@media (max-width: 768px) {
    .room-card,
    .hall-card,
    .review-card {
        animation-duration: 0.4s;
    }
    
    .hero-title {
        animation-duration: 0.8s;
    }
    
    .hero-subtitle {
        animation-duration: 0.6s;
    }
    
    .hero-search {
        animation-duration: 0.4s;
    }
}

/* Reduced motion preferences */
@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;
    }
    
    .animate-pulse,
    .animate-glow {
        animation: none !important;
    }
}

/* High contrast mode animations */
@media (prefers-contrast: high) {
    .glow-animation {
        animation: none;
    }
    
    .pulse-animation {
        animation: none;
    }
}

/* Performance optimizations */
.animate-gpu {
    transform: translateZ(0);
    will-change: transform, opacity;
}

.animate-smooth {
    backface-visibility: hidden;
    perspective: 1000;
}

/* Custom easing functions */
.ease-bounce {
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ease-elastic {
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ease-back {
    animation-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Interactive hover states */
.interactive-hover {
    transition: all 0.3s ease;
}

.interactive-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Micro-interactions */
.micro-bounce:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.micro-shake {
    animation: shake 0.5s ease-in-out;
}

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

/* Success state animations */
.success-checkmark {
    animation: drawCircle 0.5s ease-out forwards, drawCheck 0.3s ease-out 0.5s forwards;
}

@keyframes drawCircle {
    from {
        stroke-dasharray: 0 100;
    }
    to {
        stroke-dasharray: 100 100;
    }
}

@keyframes drawCheck {
    from {
        stroke-dasharray: 0 20;
    }
    to {
        stroke-dasharray: 20 20;
    }
}