:root {
    --primary: #0052CC;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #ECECEC;
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 12px;
}

/* --- Overlays (Language and Name) --- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.overlay.hidden {
    display: none !important;
}

.overlay h2 {
    color: white;
    text-align: center;
}

.overlay input,
.overlay button {
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    min-width: 200px;
    text-align: center;
}

.overlay .lang-select {
    display: flex;
    gap: 16px;
}

.overlay button {
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}

/* --- Main Chat Container --- */
.chat-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none; /* Initially hidden */
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    height: 90vh;
    max-height: 700px; /* Max height for better layout */
}

.chat-header {
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 56px;
}

.chat-header img {
    height: 20px;
    margin-right: 12px;
}

.chat-status {
    font-size: 0.8rem;
    color: #28a745;
    text-align: center;
    padding: 4px 0 8px 0;
    border-bottom: 1px solid #eee;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.message {
    margin-bottom: 12px;
    display: flex;
}

.message .bubble {
    padding: 10px 14px;
    max-width: 75%;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user .bubble {
    background: var(--primary);
    color: #fff;
    margin-left: auto;
    border-radius: 16px 16px 4px 16px;
}

.message.admin .bubble {
    background: #f1f1f1;
    color: #333;
    margin-right: auto;
    border-radius: 16px 16px 16px 4px;
}

.message .bubble img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 6px;
    display: block;
}

.message-time {
    font-size: 0.7rem;
    text-align: right;
    margin-top: 4px;
    opacity: 0.7;
}

.chat-input {
    display: flex;
    gap: 8px;
    border-top: 1px solid #ddd;
    padding: 12px;
    align-items: center;
}

.chat-input input[type="text"] {
    flex: 1;
    padding: 10px;
    font-size: 1rem;
    border-radius: 20px;
    border: 1px solid #ccc;
    padding-left: 16px;
}

.chat-input input[type="file"] {
    display: none;
}

.chat-input button,
.chat-input label {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 10px;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button {
    background: var(--primary);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1rem;
}

.disclaimer {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    padding: 8px 12px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.chat-backlink {
    text-align: center;
    padding: 12px;
}

.chat-backlink a {
    text-decoration: none;
    color: var(--primary);
    font-size: 0.9rem;
}