* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #05000a; /* Hitam pekat */
    color: #ffffff;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Background Partikel */
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.chat-wrapper {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background: rgba(15, 5, 25, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 43, 226, 0.4);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.2);
    z-index: 1;
}

header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
}

header h1 {
    color: #c77dff;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.8);
}

.chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.ai-message {
    align-self: flex-start;
}

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

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
}

.ai-message .avatar {
    background: #8a2be2;
    color: white;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.6);
}

.user-message .avatar {
    background: #333;
    color: white;
}

.text {
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-message .text {
    background: rgba(45, 16, 69, 0.8);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-top-left-radius: 0;
}

.user-message .text {
    background: #5a189a;
    border-top-right-radius: 0;
}

.input-container {
    padding: 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(138, 43, 226, 0.3);
    background: rgba(0, 0, 0, 0.4);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

input {
    flex: 1;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(138, 43, 226, 0.5);
    background: rgba(15, 5, 25, 0.9);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

input:focus {
    border-color: #e0aaff;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

button {
    padding: 0 25px;
    border-radius: 10px;
    border: none;
    background: #7b2cbf;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: #9d4edd;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.6);
}

/* Scrollbar Custom */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: #5a189a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #7b2cbf; }
