/* --- Color Palette (referenced from style.css :root) --- */
/* Ensure style.css is linked BEFORE chat.css */

/* Chat Page Specific Styles */
.chat-page-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background-color: var(--black-bean); /* Consistent background */
    color: var(--soft-off-white);
    font-family: 'Lora', serif; /* Default readable font for chat */
    overflow: hidden; /* Prevent body scroll */
}

/* Chat Header */
.chat-header {
    background-color: var(--russet); /* Darker shade for header */
    padding: 18px 25px; /* Slightly larger padding */
    display: flex;
    align-items: center;
    gap: 25px; /* More space */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); /* Deeper shadow */
    z-index: 10;
    position: relative; /* For subtle gradient if added */
}

.chat-header h2 {
    margin: 0;
    font-size: 2.2em; /* Larger, more prominent title */
    color: var(--white);
    font-family: 'Pixelify Sans', cursive; /* Already 'Pixelify Sans' */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6); /* Stronger shadow */
    letter-spacing: 1px;
}

.back-btn {
    background-color: var(--rust);
    color: var(--white);
    padding: 12px 18px; /* Adjusted padding */
    border: 2px solid var(--butterscotch);
    border-radius: 10px; /* More rounded */
    cursor: pointer;
    font-family: 'Pixelify Sans', cursive;
    font-size: 1em; /* Consistent button font size */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
}

.back-btn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Message Display Area */
.chat-messages {
    flex-grow: 1;
    padding: 25px; /* Increased padding */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px; /* More space between messages */
    background-color: rgba(0,0,0,0.1); /* Slight overlay for depth */
}

/* Custom Scrollbar for Webkit browsers */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--russet);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--butterscotch);
}


.message {
    max-width: 75%; /* Slightly wider messages */
    padding: 15px 20px; /* More padding inside bubbles */
    border-radius: 25px; /* More rounded, "pill-like" bubbles */
    line-height: 1.6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Deeper shadow for pop */
    animation: fadeInMessage 0.4s ease-out forwards; /* New message animation */
    opacity: 0; /* Start hidden for animation */
    transform: translateY(10px); /* Start slightly below for animation */
}

/* Applying Pixelify Sans to message text */
.message p {
    margin: 0; /* Remove default paragraph margins */
    font-family: 'Pixelify Sans', cursive; /* Applied Pixelify Sans here */
    font-size: 1em; /* You might need to adjust this size for readability with Pixelify Sans */
    line-height: 1.5; /* Adjust line-height if needed for Pixelify Sans */
}


/* Animation for new messages */
@keyframes fadeInMessage {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background-color: var(--xanthous);
    color: var(--black-bean);
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background-color: var(--russet);
    color: var(--soft-off-white);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    padding: 20px 25px; /* Increased padding */
    background-color: var(--russet);
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.4); /* Deeper shadow */
    gap: 15px; /* More space between input and button */
    align-items: center; /* Vertically align items */
}

#chatInput {
    flex-grow: 1;
    padding: 15px 20px; /* Larger input field */
    border: 2px solid var(--rust); /* Thicker border */
    border-radius: 10px; /* More rounded */
    font-size: 1.1em; /* Slightly larger font */
    background-color: var(--black-bean);
    color: var(--soft-off-white);
    font-family: 'Pixelify Sans', cursive; /* Applied Pixelify Sans here */
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); /* Inner shadow */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Applying Pixelify Sans to the placeholder text */
#chatInput::placeholder {
    color: rgba(var(--soft-off-white), 0.7);
    font-family: 'Pixelify Sans', cursive; /* Applied Pixelify Sans here */
    font-size: 0.9em; /* Adjust placeholder size if needed for Pixelify Sans */
}


#chatInput:focus {
    border-color: var(--butterscotch);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 8px rgba(var(--butterscotch), 0.5);
}

#sendBtn {
    background-color: var(--rust);
    color: var(--white);
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Pixelify Sans', cursive; /* Already 'Pixelify Sans' */
    font-size: 1.2em;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

#sendBtn:hover {
    background-color: var(--butterscotch);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#sendBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* --- Responsive Adjustments for Chat Interface --- */
@media (max-width: 768px) {
    .chat-header {
        padding: 15px 20px;
        gap: 15px;
    }
    .chat-header h2 {
        font-size: 1.8em;
    }
    .back-btn {
        padding: 10px 15px;
        font-size: 0.85em;
    }
    .chat-messages {
        padding: 18px;
        gap: 12px;
    }
    .message {
        max-width: 85%;
        padding: 12px 18px;
        font-size: 0.95em;
    }
    .message p { /* Responsive font size for Pixelify Sans in messages */
        font-size: 0.9em;
    }
    .chat-input-area {
        padding: 15px 20px;
        gap: 12px;
    }
    #chatInput {
        padding: 12px 15px;
        font-size: 1em;
    }
    #chatInput::placeholder { /* Responsive placeholder font size */
        font-size: 0.85em;
    }
    #sendBtn {
        padding: 12px 25px;
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .chat-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
        gap: 10px;
    }
    .chat-header h2 {
        font-size: 1.4em;
    }
    .back-btn {
        font-size: 0.8em;
        padding: 8px 12px;
    }
    .chat-messages {
        padding: 10px;
        gap: 10px;
    }
    .message {
        max-width: 90%;
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .message p { /* Responsive font size for Pixelify Sans in messages */
        font-size: 0.8em;
    }
    .chat-input-area {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }
    #chatInput {
        width: calc(100% - 20px);
        padding: 10px;
        font-size: 0.9em;
    }
    #chatInput::placeholder { /* Responsive placeholder font size */
        font-size: 0.75em;
    }
    #sendBtn {
        width: 100%;
        padding: 10px 15px;
        font-size: 1em;
    }
}