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

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

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

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

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

/* Carousel fade animation */
.carousel-fade {
    transition: opacity 0.3s ease-in-out;
}

/* Chat message animations */
.message-enter {
    animation: slideIn 0.2s ease-out;
}

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

/* Typing indicator animation */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: typing 0.8s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Improve touch targets */
    button, 
    a,
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
    }

    /* Adjust modal width for mobile */
    .max-w-md {
        max-width: 90vw !important;
        margin: 0 auto;
    }

    /* Adjust chat interface for mobile */
    .fixed.bottom-20.right-4.w-96 {
        width: 90vw !important;
        right: 5vw !important;
        left: 5vw !important;
        bottom: 80px !important;
    }

    /* Prevent body scroll when modal is open */
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* Ensure modals are full screen */
    .fixed.inset-0 {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
    }

    /* Improve touch feedback */
    .touch-feedback:active {
        opacity: 0.7;
        transition: opacity 0.2s ease;
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .h-screen {
        height: -webkit-fill-available;
    }
    
    .min-h-full {
        min-height: -webkit-fill-available;
    }
}

/* Prevent pull-to-refresh on mobile */
html, body {
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* Fix for iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio: 0) { 
    select,
    textarea,
    input {
        font-size: 16px !important;
    }
}

/* Fix for iOS momentum scrolling */
.scroll-container {
    -webkit-overflow-scrolling: touch;
}

/* Improve tap highlight color */
* {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Fix for iOS rubber band effect */
body {
    overscroll-behavior-y: none;
}

/* Modal animations */
.modal-enter {
    animation: modalFadeIn 0.2s ease-out;
}

.modal-backdrop-enter {
    animation: backdropFadeIn 0.2s ease-out;
}

.modal-content-enter {
    animation: modalScaleIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-leave {
    animation: modalFadeOut 0.15s ease-in;
}

.modal-backdrop-leave {
    animation: backdropFadeOut 0.15s ease-in;
}

.modal-content-leave {
    animation: modalScaleOut 0.15s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

@keyframes modalScaleIn {
    from {
        transform: scale(0.8) translateY(10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes modalScaleOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.8) translateY(10px);
        opacity: 0;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.75;
    }
}

@keyframes backdropFadeOut {
    from {
        opacity: 0.75;
    }
    to {
        opacity: 0;
    }
}

/* Carousel indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.carousel-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    cursor: pointer;
}

.carousel-indicator.active {
    background-color: white;
    transform: scale(1.2);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .carousel-indicators {
        display: flex;
        gap: 4px;
        margin-top: 8px;
    }
    
    .carousel-indicator {
        width: 4px;
        height: 4px;
    }
    
    .carousel-indicator.active {
        transform: scale(1.1);
    }
}

/* Carousel indicator transitions */
.carousel-indicator {
    transition: all 0.2s ease;
}

/* Touch feedback */
.touch-feedback:active {
    transition: opacity 0.15s ease;
}