.title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
    text-align: center;
}

.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: currentColor;
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s steps(1, end) infinite;
    position: relative;
    top: -1px;
}

@keyframes blink {
    0%, 100% { visibility: visible; }
    50% { visibility: hidden; }
}

.hljs {
    background: #2d2d2d !important;
    border-radius: 6px;
    padding: 16px !important;
}

.chat-container {
    width: 100%;
    max-width: 1000px;
    background: #1e1e1e;
    border-radius: 25px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    height: 60vh;
    opacity: 0;
    animation: fadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #D8BFD8 transparent;
}

.chat-box::-webkit-scrollbar {
    width: 6px;
}

.chat-box::-webkit-scrollbar-thumb {
    background-color: #D8BFD8;
    border-radius: 3px;
}

.message {
    padding: 12px 16px;
    border-radius: 20px;
    max-width: 80%;
    position: relative;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.user {
    background: #4e91d8;
    align-self: flex-end;
    color: white;
    border-bottom-right-radius: 5px;
    margin-left: auto;
}

.ai {
    background: #333;
    align-self: flex-start;
    color: white;
    border-bottom-left-radius: 5px;
    margin-right: auto;
}

.message-content {
    width: 100%;
    overflow: hidden;
}

.message pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    max-width: 100%;
    background: #2d2d2d;
    padding: 12px;
    border-radius: 6px;
    margin: 8px 0;
}

.message code.inline-code {
    white-space: normal;
    word-break: break-word;
    background: #282a36;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    color: #f8f8f2;
}

.loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #D8BFD8;
    border-radius: 50%;
    animation: loadingBounce 1.4s infinite;
    margin: 0 2px;
}

@keyframes loadingBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

.input-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
    padding: 5px;
}

input {
    flex: 1;
    padding: 10px 15px;
    height: 40px;
    border: none;
    border-radius: 25px;
    background: #333;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0;
    transition: box-shadow 0.2s ease;
}

input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #D8BFD8;
}

button {
    background: #D8BFD8;
    color: #fff;
    font-size: 1rem;
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 40px;
    white-space: nowrap;
    font-weight: 500;
}

button:hover {
    background: #D8BFD1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
}

.copy-btn,
.delete-btn {
    position: absolute;
    top: 8px;
    background: rgba(40,40,40,0.85);
    color: #fff;
    padding: 5px 10px;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message:hover .copy-btn,
.message:hover .delete-btn {
    opacity: 1;
    transform: translateY(0);
}

.copy-btn:hover,
.delete-btn:hover {
    background: rgba(72,72,72,0.95);
}

.copy-btn {
    right: 55px;
}

.delete-btn {
    right: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message strong {
    font-weight: bold;
    color: #ff79c6;
}

.message em {
    font-style: italic;
    color: #50fa7b;
}

@media (max-width: 768px) {
    .message {
        max-width: 90%;
        padding: 10px 14px;
    }
    
    button {
        padding: 10px 20px;
    }
    
    .copy-btn {
        right: 50px;
    }
}