/* Basic Reset and Font Import */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans', sans-serif;
    background-image: url('https://himalayaguidenepal.com/wp-content/uploads/2024/05/8-Highest-Mountains-in-Nepal.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 15px;
}

/* Main Chat Container with Glassmorphism Effect */
.chat-container {
    width: 100%;
    max-width: 700px;
    height: 95vh;
    max-height: 800px;
    background: rgba(20, 20, 30, 0.75); /* Semi-transparent background */
    backdrop-filter: blur(12px) saturate(150%); /* The glass effect */
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Chat Header */
.chat-header {
    background: rgba(40, 40, 50, 0.5);
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}
.header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.header-info h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #f5f5f5;
}
.header-info .status {
    color: #4ade80; /* Green for online */
    font-size: 0.8rem;
}

/* Chat Board - The main message area */
.chat-board {
    flex-grow: 1;
    padding: 20px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.chat-board::-webkit-scrollbar { width: 6px; }
.chat-board::-webkit-scrollbar-track { background: transparent; }
.chat-board::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.2); border-radius: 10px; }

/* Individual Message Container */
.message-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 75%;
    align-self: flex-start;
    animation: fadeIn 0.3s ease-out;
}
.message-container.reversed {
    flex-direction: row-reverse;
    align-self: flex-end;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Avatar Styling */
.avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Message Content Block */
.message-content { display: flex; flex-direction: column; }
.sender-name {
    font-size: 0.75em;
    color: #b0b0b0;
    margin-bottom: 4px;
    padding: 0 8px;
}
.message-container.reversed .sender-name { text-align: right; }

/* The actual message bubble */
.message-text {
    background: rgba(60, 60, 75, 0.7);
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    color: #f0f0f0;
}

/* Different bubble styles for each sender */
.message-container .message-text { border-bottom-left-radius: 5px; }
.message-container.reversed .message-text {
    background: linear-gradient(135deg, #007BFF, #0056b3);
    color: white;
    border-bottom-right-radius: 5px;
}

/* Event text (centered, italic) */
.chat-event {
    text-align: center;
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-size: 0.85em;
}

/* Chat Input Panel at the bottom */
.chat-panel {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(40, 40, 50, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    gap: 10px;
}

.chat-input {
    flex-grow: 1;
    border: none;
    padding: 12px 18px;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.25);
    color: #f5f5f5;
    outline: none;
    font-size: 1rem;
    transition: background 0.2s;
}
.chat-input::placeholder { color: #888; }
.chat-input:focus { background: rgba(0, 0, 0, 0.4); }

.panel-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #b0b0b0;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}
.panel-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.send-button {
    color: #007BFF;
}
.send-button:hover {
    color: #3399ff;
}