/* Basic Styling - Add more comprehensive styles later */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

header, footer {
    background-color: #333;
    color: #fff;
    padding: 1em 0;
    text-align: center;
}

main {
    padding: 20px;
    max-width: 1000px;
    margin: 20px auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Add chat widget specific styles here */
.chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 999;
}

.chat-container {
    position: fixed;
    bottom: 90px; /* Above the icon */
    right: 20px;
    /* width: 350px; */
    width: 420px;
    max-width: 90vw;
    /* height: 500px; */
    max-height: 80vh;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out; /* Animation */
}

.chat-container.main-menu-expanded {
    height: 750px;
}

.chat-container.hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none; /* Prevent interaction when hidden */
}

.chat-header {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.2;
}
.chat-header .company-name {
    font-size: 0.8em;
    opacity: 0.9;
}

#close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
}

.chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 10px;
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 15px;
    line-height: 1.4;
}

.user-message {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background-color: #e9e9eb;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.agent-message {
    background-color: #28a745; /* Green for agent */
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.system-message {
    font-style: italic;
    color: #666;
    text-align: center;
    font-size: 0.9em;
    margin: 10px 0;
    align-self: center;
    max-width: 100%;
}

.message p {
    margin: 0;
}

.message .sender {
    display: block;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 3px;
    color: #555;
}

.agent-message .sender {
     color: #e0ffe0; /* Lighter color for sender label on agent messages */
}

.chat-options {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
}

#faq-buttons-container h4 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #555;
}

#faq-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.faq-button,
.option-button {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.faq-button:hover,
.option-button:hover {
    background-color: #e0e0e0;
}

.option-button {
    width: 100%;
    text-align: center;
    background-color: #6c757d;
    color: white;
    border: none;
    margin-top: 5px;
}

.option-button:hover {
    background-color: #5a6268;
}

.chat-input-area {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 8px 12px;
    margin-right: 10px;
    resize: none; /* Prevent manual resize */
    min-height: 20px; /* Initial height for one line */
    max-height: 80px; /* Limit growth */
    overflow-y: auto; /* Scroll if needed */
    font-size: 1em;
    line-height: 1.4;
}

#send-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #007bff;
}

#send-button svg {
    display: block;
}

#send-button:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1010; /* Above chat widget */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1011;
    width: 400px;
    max-width: 90vw;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}
.modal-content p {
    margin-bottom: 20px;
    color: #555;
    font-size: 0.95em;
}

#agent-connect-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: #444;
}

#agent-connect-form input[type="text"],
#agent-connect-form input[type="email"],
#agent-connect-form input[type="tel"],
#agent-connect-form textarea {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width */
    font-size: 1em;
}

#agent-connect-form textarea {
    resize: vertical;
    min-height: 60px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.submit-button,
.cancel-button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}

.submit-button {
    background-color: #007bff;
    color: white;
}

.submit-button:hover {
    background-color: #0056b3;
}

.cancel-button {
    background-color: #ccc;
    color: #333;
}

.cancel-button:hover {
    background-color: #bbb;
}

/* Agent Chat Page Specific Styles */
.agent-chat-page {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full viewport height */
    max-width: 800px; /* Limit width */
    margin: 0 auto; /* Center */
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.agent-header {
    background-color: #6c757d; /* Different color for agent header */
}

.agent-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
}

.agent-input {
     border-top: 1px solid #ccc;
} 