/* ============================================================
   WalnBot Chat Page
   ============================================================ */

/* ---------- Page shell ---------- */
.wb-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    margin-top: 80px;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    background: #0d0d0d;
    border-left: 1px solid rgba(196, 157, 72, 0.1);
    border-right: 1px solid rgba(196, 157, 72, 0.1);
}

/* ---------- Header ---------- */
.wb-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid rgba(196, 157, 72, 0.15);
    flex-shrink: 0;
}

.wb-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(196, 157, 72, 0.2), rgba(196, 157, 72, 0.05));
    border: 1px solid rgba(196, 157, 72, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wb-avatar i {
    font-size: 1.3rem;
    color: #c49d48;
}

.wb-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #0d0d0d;
}

.wb-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wb-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
    font-family: 'Jost', sans-serif;
}

.wb-status {
    font-size: 0.78rem;
    color: #666;
    font-family: 'Jost', sans-serif;
}

.wb-clear-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #555;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.wb-clear-btn:hover:not(:disabled) {
    border-color: rgba(196, 157, 72, 0.3);
    color: #c49d48;
}

.wb-clear-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---------- Messages area ---------- */
.wb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.wb-messages::-webkit-scrollbar {
    width: 4px;
}

.wb-messages::-webkit-scrollbar-track {
    background: transparent;
}

.wb-messages::-webkit-scrollbar-thumb {
    background: rgba(196, 157, 72, 0.2);
    border-radius: 2px;
}

/* ---------- Message rows ---------- */
.wb-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 80%;
    animation: wb-fadein 0.2s ease;
}

.wb-msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.wb-msg--bot {
    align-self: flex-start;
}

@keyframes wb-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Avatar (small) ---------- */
.wb-avatar-sm {
    width: 30px;
    height: 30px;
    background: rgba(196, 157, 72, 0.1);
    border: 1px solid rgba(196, 157, 72, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.wb-avatar-sm i {
    font-size: 0.85rem;
    color: #c49d48;
}

/* ---------- Bubbles ---------- */
.wb-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.93rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Jost', sans-serif;
}

.wb-msg--bot .wb-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #d8d8d8;
    border-top-left-radius: 4px;
}

.wb-msg--user .wb-bubble {
    background: linear-gradient(135deg, #c49d48, #e0b85a);
    color: #000;
    font-weight: 500;
    border-top-right-radius: 4px;
    border: none;
}

/* ---------- Typing indicator ---------- */
.wb-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
}

.wb-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #c49d48;
    border-radius: 50%;
    opacity: 0.4;
    animation: wb-bounce 1.2s ease-in-out infinite;
}

.wb-typing span:nth-child(2) { animation-delay: 0.2s; }
.wb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wb-bounce {
    0%, 80%, 100% { opacity: 0.4; transform: translateY(0); }
    40%            { opacity: 1;   transform: translateY(-5px); }
}

/* ---------- Input bar ---------- */
.wb-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: rgba(10, 10, 10, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.wb-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    color: #e8e8e8;
    font-family: 'Jost', sans-serif;
    font-size: 0.93rem;
    padding: 11px 18px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.wb-input:focus {
    border-color: rgba(196, 157, 72, 0.4);
    background: rgba(196, 157, 72, 0.04);
}

.wb-input::placeholder { color: #444; }

.wb-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wb-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c49d48, #e0b85a);
    border: none;
    color: #000;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(196, 157, 72, 0.3);
}

.wb-send-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(196, 157, 72, 0.45);
}

.wb-send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .wb-page {
        border-left: none;
        border-right: none;
    }
}

@media (max-width: 480px) {
    .wb-msg { max-width: 92%; }
    .wb-header { padding: 14px 16px; }
    .wb-messages { padding: 20px 14px; }
    .wb-input-bar { padding: 12px 14px; }
}
