/* Mobile-specific enhancements for the chatbot interface */

/* General body state when info panel is shown */
body.info-panel-open {
    overflow: hidden;
    position: relative;
}

/* Backdrop overlay when the info panel is open on mobile */
body.info-panel-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
}

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

/* Better text sizing for messages on mobile */
@media (max-width: 768px) {
    /* Make sure the chat bubbles don't get too small on mobile */
    .message {
        word-break: break-word;
        hyphens: auto;
    }

    /* Message animations should be quicker on mobile */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(5px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Make the suggestions more accessible on mobile */
    .suggestions {
        margin: 1rem 0 2rem;
    }

    .suggestion-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.8rem;
        justify-content: center;
    }

    .suggestion-btn {
        font-size: 1.3rem;
        padding: 0.7rem 1.2rem;
        background-color: var(--white);
        border: 1px solid var(--primary-color);
        color: var(--primary-color);
        border-radius: 2rem;
        cursor: pointer;
        transition: all 0.2s ease;
        flex: 1 1 auto;
        min-width: 130px;
        text-align: center;
    }

    .suggestion-btn:hover, .suggestion-btn:active {
        background-color: var(--primary-color);
        color: var(--white);
    }

    /* Fix any padding issues on the main container */
    .chat-interface-section .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Improve the refresh chat button positioning */
    .chat-action {
        width: 3.2rem;
        height: 3.2rem;
        font-size: 1.4rem;
    }

    /* Ensure the chat automatically scrolls to the bottom on mobile */
    .chat-messages {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* Fix for iOS devices to prevent unnecessary zooming on input fields */
@media (max-width: 768px) {
    input[type="text"],
    textarea {
        font-size: 16px;
    }
}
