/* GENERAL RESET */
* {
    box-sizing: border-box;
}

body {
    background: #0f0f0f;
    color: #eee;
    font-family: system-ui, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

/* LOGIN BOX */
.login-box {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-box h2 {
    margin-bottom: 15px;
    font-size: 1.5em;
}

.login-box input {
    margin: 10px 0;
    padding: 12px;
    width: 100%;
    border: none;
    border-radius: 8px;
    font-size: 1em;
}

button {
    padding: 12px;
    background: #6b4ce6;
    border: none;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
    transition: background 0.2s;
}

button:hover {
    background: #7b5af2;
}

.error {
    color: #f55;
    text-align: center;
}

/* CHAT BOX */
.chat-container {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 10px;
    width: 95%;
    max-width: 500px;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 1.2em;
    margin: 0;
}

.logout-btn {
    background: #f33;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
}

#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid #333;
    padding: 10px;
    margin-bottom: 10px;
    background: #141414;
    border-radius: 8px;
    scroll-behavior: smooth;
}

.msg {
    margin: 6px 0;
    line-height: 1.4em;
    word-wrap: break-word;
}

.input-area {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#user-input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
}

#send-btn {
    flex-shrink: 0;
    background: #6b4ce6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 1em;
}

#token-info {
    text-align: right;
    font-size: 0.85em;
    color: #aaa;
    margin-top: -5px;
}

/* SCROLLBAR FOR MOBILE */
#chat-box::-webkit-scrollbar {
    width: 6px;
}

#chat-box::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

/* RESPONSIVE BEHAVIOR */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
        padding-top: 20px;
    }

    .chat-container {
        height: calc(100vh - 30px);
        width: 95%;
    }

    #chat-box {
        height: auto;
        max-height: 70vh;
    }

    .header h1 {
        font-size: 1em;
    }

    #user-input, #send-btn {
        font-size: 1em;
        padding: 10px;
    }
}