/* chat.css */

.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chat-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.chatbox {
    width: 90%;
    max-width: 400px;
    height: 80vh;
    max-height: 600px;
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(255, 170, 0, 0.25);
}

.chat-overlay.open .chatbox {
    transform: translateY(0) scale(1);
}

.chatbox header {
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Bevan', serif;
    color: #ffaa00;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

.chatbox header span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbox header button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.chatbox header button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.msg {
    padding: 0.875rem 1.25rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
}

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

.msg.assistant {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.msg.user {
    background: linear-gradient(135deg, #ffaa00, #ff8c00);
    color: #000000;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.chat-form {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 0.75rem;
}

.chat-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.75rem 1.25rem;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.chat-form input:focus {
    border-color: #ffaa00;
    background: rgba(255, 255, 255, 0.1);
}

.chat-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-form button {
    background: #ffaa00;
    color: #000000;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-form button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}

.chat-form button:active {
    transform: scale(0.95);
}
