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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
    color: #e0e0e0;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

.app-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.header {
    width: 100%;
    padding: 20px;
    text-align: left;
    max-width: 900px;
}

.header h1 {
    font-size: 24px;
    font-weight: 500;
    color: #fff;
}

.header span {
    font-size: 14px;
    color: #a0a0a0;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

.chat-container {
    flex: 1;
    width: 100%;
    max-width: 900px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Hide scrollbar for a cleaner look */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.chat-container::-webkit-scrollbar { 
    display: none;
}

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

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

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.message.user .avatar {
    background: rgba(100, 150, 255, 0.3);
}

.bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.message.user .bubble {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-right-radius: 4px;
}

.message.system .bubble {
    border-bottom-left-radius: 4px;
}

.input-container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    padding-bottom: 40px;
}

#chat-form {
    display: flex;
    align-items: center;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 8px 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

#chat-form:focus-within {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: #fff;
    font-size: 16px;
    outline: none;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#send-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#send-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
