/* General settings */
:root {
  --main: #004589;
  --mainlight: #0555a4;
  --maindark: #003569;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.chat-container {
    width: 100%;
    max-width: 500px;
    height: 85vh;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    text-align: center;
    padding: 15px;
    background-color: var(--main);
    color: #fff;
    font-size: 24px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 4px solid var(--maindark);
}

.restaurant-logo {
    height: 40px;
    margin-bottom: 10px;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #fafafa;
    scrollbar-width: thin;
    scrollbar-color: #ddd #fafafa;
}

/* Message styling */
.message {
    margin: 10px 0;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 75%;
    line-height: 1.5;
    font-size: 16px;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in;
}

.user-message {
    background-color: var(--main);
    color: #fff;
    align-self: flex-end;
}

.ai-message {
    background-color: #e0e0e0;
    color: #333;
    align-self: flex-start;
}

/* Typing indicator */
.typing-indicator {
    padding: 10px;
    text-align: left;
    color: #888;
    font-size: 14px;
    margin-left: 10px;
}

/* Chat form styling */
.chat-form {
    display: flex;
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

.chat-form input {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 30px;
    background-color: #f0f0f0;
    color: #333;
    font-size: 16px;
    outline: none;
    transition: background-color 0.3s ease;
}

.chat-form input:focus {
    background-color: #e0e0e0;
}

.chat-form button {
    padding: 0 16px;
    background-color: var(--main);
    border: none;
    color: white;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
}

.chat-form button:hover {
    background-color: var(--mainlight) ;
}

.chat-form button .material-icons {
    font-size: 24px;
    color: white;
}

/* Clear Chat Button */
.clear-chat-btn {
    background-color: #e74c3c;
    border: none;
    color: #fff;
    font-size: 14px;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    margin: 15px;
    align-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.clear-chat-btn:hover {
    background-color: #c0392b;
}

.clear-chat-btn .material-icons {
    font-size: 24px;
    color: white;
}

/* Scrollbar styling */
.chat-box::-webkit-scrollbar {
    width: 8px;
}

.chat-box::-webkit-scrollbar-track {
    background-color: #fafafa;
}

.chat-box::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 10px;
}

/* Message fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Define the fade-out animation */
.fade-out {
    animation: fadeOut 0.5s forwards;
}

/* Keyframes for the fade-out animation */
@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}


/* Summary Section */
.summary {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin-top: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    display: none;
}

.summary h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-item img {
    width: 50px;
    height: 50px;
    margin-right: 10px;
}

.summary-item span {
    font-size: 14px;
    color: #666;
}

.summary-total {
    font-weight: bold;
    margin-top: 20px;
    font-size: 18px;
}

.confirm-order {
    display: block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
    text-align: center;
}

.remove-item-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #e74c3c;
}

.remove-item-btn:hover {
    color: #c0392b;
}



/* Container for each summary item */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Styling for item details (image and name/price) */
.item-details {
    display: flex;
    align-items: center;
}

.item-image {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    border-radius: 5px;
    object-fit: cover;
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 500;
}

.item-price {
    color: #888;
}

/* Styling for quantity input */
.item-quantity {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.item-quantity-input {
    width: 50px;
    padding: 5px;
    text-align: center;
    font-size: 16px;
    margin-right: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.item-total {
    font-weight: bold;
}

/* Styling for the remove button */
.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.remove-item:hover {
    color: #c0392b;
}

.remove-item i {
    margin-right: 5px;
}

/* Total Price Styling */
.summary-total {
    font-weight: bold;
    margin-top: 20px;
    font-size: 18px;
}

/* Confirm Order Button Styling */
.confirm-order {
    display: block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}


@media only screen and (max-width: 600px) {
    .container {
        flex-direction: column;
    }
}
