/* Reset some basic styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Background for the whole page or chat area */
body {
    background: linear-gradient(135deg, #ece9e6, #ffffff);
    background-attachment: fixed;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Chat container */
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: 100vh;
}

/* Header */
header {
    background-color: #4CAF50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

.language-switcher button {
    background-color: white;
    color: #4CAF50;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.language-switcher button:hover {
    background-color: #e8f5e9;
}

/* Chat Display */
#chat-display {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    height: calc(100vh - 150px); /* Adjust based on header and input height */
}

/* Message Styles */
.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.95em;
    word-wrap: break-word;
    line-height: 1.4;
}

.user-message {
    align-self: flex-end;
    background-color: #e3f2fd;
    border-radius: 18px 18px 0 18px;
    margin-left: auto;
}

.bot-message {
    align-self: flex-start;
    background-color: #f1f1f1;
    border-radius: 18px 18px 18px 0;
    margin-right: auto;
}

/* Welcome Message */
.welcome-message {
    padding: 15px;
    background-color: #e8f5e9;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
}

.welcome-message h3 {
    color: #2e7d32;
    margin-bottom: 10px;
}

.example-questions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.example-btn {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 20px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.example-btn:hover {
    background-color: #bbdefb;
}

/* Input Area */
.input-area {
    display: flex;
    gap: 10px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    position: sticky;
    bottom: 0;
    border-top: 1px solid #ddd;
}

#user-query {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    min-height: 50px;
    max-height: 120px;
    resize: none;
}

#send-btn {
    padding: 12px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    align-self: flex-end;
    height: 50px;
}

#send-btn:hover {
    background-color: #45a049;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px 10px;
    font-size: 0.9em;
}

.footer-content {
    max-width: 1200px;
    margin: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        padding: 0;
    }

    #chat-display {
        height: calc(100vh - 140px); /* Full height minus header and input */
        padding: 10px;
    }

    .header-content {
        padding: 0 10px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .input-area {
        padding: 8px;
    }

    #user-query {
        min-height: 45px;
        font-size: 0.9rem;
    }

    #send-btn {
        padding: 8px 15px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    #chat-display {
        height: calc(100vh - 130px); /* Adjust for smaller devices */
    }

    .message {
        max-width: 90%;
        font-size: 0.85em;
        padding: 8px 12px;
    }
}

/* Images inside chat messages */
.message img, .bot-message img, .user-message img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid #ddd;
    display: block;
}

/* Scrollbar styling */
#chat-display::-webkit-scrollbar {
    width: 6px;
}

#chat-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chat-display::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#chat-display::-webkit-scrollbar-thumb:hover {
    background: #555;
}
