.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Scrollbar */
.chat-list::-webkit-scrollbar,
.messages::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb {
    background: #c3c6d1;
    border-radius: 999px;
}

/* Chat list items */
.chat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: #506169;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.chat-item:hover {
    background: #e2e3e5;
    color: #191c1e;
}

.chat-item.active {
    background: #ffffff;
    color: #001e40;
    box-shadow: 0 1px 3px rgba(0, 30, 64, 0.08);
}

/* Delete button on chat items */
.chat-item-delete {
    display: none;
    margin-left: auto;
    padding: 2px;
    background: none;
    border: none;
    color: #737780;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
}

.chat-item-delete:hover {
    color: #ba1a1a;
    background: rgba(186, 26, 26, 0.08);
}

.chat-item:hover .chat-item-delete {
    display: flex;
}

/* Messages */
.message-row {
    display: flex;
    width: 100%;
    animation: slideUp 0.2s ease;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.bot {
    justify-content: flex-start;
}

/* User message bubble */
.message-row.user .message-inner {
    max-width: 80%;
}

.message-row.user .message {
    background: #e7e8ea;
    color: #191c1e;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Bot message card */
.message-row.bot .message-inner {
    max-width: 90%;
}

.message-row.bot .message {
    background: #ffffff;
    border-left: 2px solid #e9c176;
    padding: 1.5rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0px 24px 48px rgba(0, 30, 64, 0.04);
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #191c1e;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Bot message header */
.bot-message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.bot-message-header .icon-box {
    width: 2rem;
    height: 2rem;
    background: #001e40;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-message-header .icon-box .material-symbols-outlined {
    color: white;
    font-size: 1.125rem;
    font-variation-settings: 'FILL' 1;
}

.bot-message-header .title {
    font-family: 'Noto Serif', serif;
    font-weight: 700;
    color: #001e40;
    font-size: 1.125rem;
}

/* Loading state */
.message.loading {
    color: #737780;
    font-style: italic;
    border-left-color: #c3c6d1;
}

.message.loading .bot-message-header .title {
    color: #737780;
}

/* Copy button on bot messages */
.bot-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.bot-actions button {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    background: #e7e8ea;
    color: #43474f;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bot-actions button:hover {
    background: #d9dadc;
}

.bot-actions button .material-symbols-outlined {
    font-size: 0.875rem;
}

/* Empty state */
.messages.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.messages.empty::before {
    content: 'Заңгерлік сұрағыңызды төменге жазыңыз немесе жаңа чат бастаңыз.';
    max-width: 420px;
    color: #737780;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
}

/* Timestamp */
.msg-timestamp {
    font-size: 10px;
    color: #a0a3ab;
    font-weight: 500;
    padding: 0 0.5rem;
    margin-top: 0.5rem;
}

.message-row.user .msg-timestamp {
    text-align: right;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Send button disabled */
#send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive: Tablet */
@media (max-width: 900px) {
    .sidebar {
        width: 72px !important;
        min-width: 72px !important;
        padding: 10px 8px;
    }

    .sidebar .mb-8 {
        display: none;
    }

    .btn-new-chat span:not(.material-symbols-outlined) {
        display: none;
    }

    .btn-new-chat {
        padding: 0.75rem;
    }

    .sidebar .pt-4 span:not(.material-symbols-outlined) {
        display: none;
    }

    .chat-item {
        font-size: 0;
        justify-content: center;
        padding: 0.75rem 0.5rem;
    }

    .chat-item::before {
        content: "chat";
        font-family: 'Material Symbols Outlined';
        font-size: 20px;
        color: inherit;
    }

    .chat-item-delete {
        display: none !important;
    }
}

/* Responsive: Mobile */
@media (max-width: 640px) {
    .sidebar {
        display: none !important;
    }

    .messages {
        padding: 1rem !important;
    }

    .message-row.user .message-inner {
        max-width: 92%;
    }

    .message-row.bot .message-inner {
        max-width: 100%;
    }

    .message-row.bot .message {
        padding: 1rem 1.25rem;
    }

    footer {
        padding: 1rem !important;
    }
}
