/* Google Fonts - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #163a69;
    --primary-dark: #0f2a4e;
    --primary-light: #1e4f90;
    --accent-green: #4caf50;
    --bg-color: #f0f4f8;
    --chat-bg: #ffffff;
    --text-color: #1a2a3a;
    --text-muted: #5a6e82;
    --user-msg-bg: #163a69;
    --user-msg-text: #ffffff;
    --bot-msg-bg: #eef3f9;
    --bot-msg-text: #1a2a3a;
    --input-bg: #f7f9fc;
    --border-color: #d0dce8;
    --shadow-md: 0 4px 6px -1px rgba(22, 58, 105, 0.1), 0 2px 4px -1px rgba(22, 58, 105, 0.06);
    --shadow-lg: 0 10px 25px -3px rgba(22, 58, 105, 0.18), 0 4px 8px -2px rgba(22, 58, 105, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    /* background: #e8eef5; */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
}

/* Widget Container */
.widget-container {
    width: 100%;
    height: 100vh;
    background: var(--chat-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

/* Header */
.chat-header {
    background: var(--primary-color);
    padding: 18px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--accent-green);
}

.chat-header h1 {
    font-size: 1.15rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.2px;
}

.chat-header .status {
    font-size: 0.75rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 300;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-green);
}

/* Chat Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    background: #f7f9fc;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 11px 15px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.55;
    position: relative;
    animation: fadeIn 0.25s ease;
    font-family: 'Poppins', sans-serif;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    background: var(--bot-msg-bg);
    color: var(--bot-msg-text);
    align-self: flex-start;
    border-bottom-left-radius: 3px;
    border: 1px solid #dde7f0;
}

.message.user {
    background: var(--user-msg-bg);
    color: var(--user-msg-text);
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 5px;
    padding: 8px 20px;
    background: var(--chat-bg);
    border-top: 1px solid var(--border-color);
    width: 100%;
    align-items: center;
    min-height: 36px;
}

.typing span {
    width: 6px;
    height: 6px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Input Area */
.input-area {
    padding: 12px 5px 15px 1px;
    border-top: 1px solid var(--border-color);
    background: var(--chat-bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-row {
    display: flex;
    gap: 2px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 25px;
    background: var(--input-bg);
    font-family: 'Poppins', sans-serif;
    font-size: 0.87rem;
    outline: none;
    transition: border-color 0.2s;
    color: var(--text-color);
}

.chat-input:focus {
    border-color: var(--primary-color);
}

.chat-input::placeholder {
    color: #94a8bc;
    font-size: 0.83rem;
}

.send-btn,
.attach-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn {
    background: var(--primary-color);
    color: white;
}

.send-btn:hover {
    background: var(--primary-dark);
}

.attach-btn:hover {
    background: var(--bg-color);
}

/* Buttons Container */
.buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    padding: 0 2px;
}

.option-btn {
    background: #4caf50;
    /* border: 1.5px solid var(--primary-color); */
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(22, 58, 105, 0.15);
}

.option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login/Start Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    gap: 18px;
}

.start-screen h2 {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

.start-screen p {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 5px;
    font-weight: 300;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
}

.form-group input {
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.87rem;
    outline: none;
    transition: border-color 0.2s;
    color: var(--text-color);
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.start-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 13px;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.start-btn:hover {
    background: var(--primary-dark);
}

.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #b0c4d8;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8aa5be;
}

/* Upload styling */
.file-preview {
    font-size: 0.78rem;
    font-family: 'Poppins', sans-serif;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 5px 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.remove-file {
    cursor: pointer;
    color: #e53935;
    font-weight: bold;
    margin-left: 5px;
}