body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Container */
.chat-container {
    width: 400px;
    max-width: 95%;
    height: 600px;
    background: #f5f7fa;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Header */
.chat-header {
    background: linear-gradient(90deg, #4e73df, #1cc88a);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-weight: 600;
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
}

/* Home link */
.back-home {
    position: absolute;
    left: 15px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
    transition: 0.2s ease;
}

.back-home:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Chat area */
.chat-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Message alignment */
.message {
    display: flex;
    margin-bottom: 10px;
}

.message.me {
    justify-content: flex-end;
}

.message.other {
    justify-content: flex-start;
}

/* Bubble */
.bubble {
    padding: 10px 14px;
    border-radius: 15px;
    max-width: 75%;
    font-size: 14px;
}

.message.me .bubble {
    background: #4e73df;
    color: white;
    border-bottom-right-radius: 3px;
}

.message.other .bubble {
    background: #e4e6eb;
    border-bottom-left-radius: 3px;
}

/* Input */
.chat-input {
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #ddd;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ccc;
    outline: none;
}

.chat-input button {
    margin-left: 10px;
    padding: 10px 18px;
    border-radius: 20px;
    border: none;
    background: #4e73df;
    color: white;
    cursor: pointer;
}

/* Login */
.login-box {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box form {
    text-align: center;
}

.login-box input {
    padding: 10px;
    width: 200px;
    border-radius: 20px;
    border: 1px solid #ccc;
}

.login-box button {
    margin-top: 10px;
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    background: #4e73df;
    color: white;
}

/* Mobile */
@media (max-width: 600px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}
