:root {
    --color-red: #ef4444;
    --color-red-light: #dc2626;
}

/* Layout */

.container {
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    background: var(--color-glass);
    padding: 24px;
}

/* Header */

h2 {
    margin: 0 0 24px;
    text-align: center;

    color: var(--bg-color-darkb);

    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Forms */

label {
    display: block;
    margin-bottom: 8px;
    margin-top: 16px;

    font-weight: 600;
    color: var(--bg-color-darkb);
}

.input-field {
    width: 100%;

    padding: 12px 14px;

    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: var(--radius-md);

    background: rgba(255, 255, 255, 0.85);

    color: var(--color-text);
    font-size: 14px;
    box-sizing: border-box;

    transition: all 0.2s ease;
}

.input-field:hover {
    outline: none;

    border-color: var(--color-primary);

    box-shadow:
        0 0 0 4px rgba(74, 144, 226, 0.15),
        0 4px 12px rgba(74, 144, 226, 0.12);
}

/* Chat */
#chat {
    height: 400px;
    overflow-y: auto;
    padding: 18px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    margin-top: 15px;

    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}


/* Typing indicator */
.msg.bot.typing-wrapper {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.04);
  max-width: 60%;
  margin-bottom: 10px;
}

.typing .dot {
  width: 8px;
  height: 8px;
  background: var(--color-primary, #4a90e2);
  border-radius: 50%;
  opacity: 0.25;
  transform: translateY(0);
  animation: typing-bounce 1s infinite;
}

.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.typing .dot:nth-child(3) { animation-delay: 0.30s; }

@keyframes typing-bounce {
  0%   { opacity: 0.25; transform: translateY(0); }
  30%  { opacity: 1;    transform: translateY(-6px); }
  60%  { opacity: 0.5;  transform: translateY(0); }
  100% { opacity: 0.25; transform: translateY(0); }
}

/* Input Area */

.input-row {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.input-row input {
    flex: 1;
}

button {
    padding: 12px 24px;

    border: none;
    border-radius: var(--radius-md);

    background: linear-gradient(
        135deg,
        var(--color-primary),
        var(--color-accent)
    );

    color: white;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

#clearBtn {
    white-space: nowrap;
    background: linear-gradient(
        135deg,
        var(--color-red),
        var(--color-red-light)
    );
}

#clearBtn:hover {
    box-shadow:
        0 8px 18px rgba(226, 74, 74, 0.3),
        0 2px 6px rgba(226, 74, 74, 0.2);
}

button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 18px rgba(74, 144, 226, 0.3),
        0 2px 6px rgba(74, 144, 226, 0.2);
}

button:active {
    transform: translateY(0);
}

/* User Messages */
.msg.user {
    max-width: 80%;
    background: rgba(255, 255, 255, 0.85);
    padding: 12px 14px;
    border-radius: 14px;
    margin: 0 0 10px auto;
}

/* Bot messages */
.msg.bot {
  max-width: 80%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(74, 144, 226, 0.15);
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
}

.response {
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.thinking-content {
  margin-top: 8px;
  color: black;
  font-size: 12px;
  opacity: 0.85;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 6px;
}

.msg.bot details {
  font-size: 14px;
  cursor: pointer;
}

/* Footer */

footer {
  margin-top: 15px;
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0.75;
}

/* Scrollbar */

#chat::-webkit-scrollbar {
    width: 10px;
}

#chat::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

#chat::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 999px;
}

#chat::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

/* Mobile */

@media (max-width: 700px) {
    .container {
        padding: 18px;
    }

    .input-row {
        flex-direction: column;
        justify-content: center;
        min-width: 0;
    }

    button {
        width: 100%;
    }

    #chat {
        height: 60vh;
    }
}
