* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 18px;
    background-color: #f0f2f5;
    height: 100vh;
    overflow: hidden;
}

/* User Selection Screen */
.selection-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.selection-screen h1 {
    color: white;
    font-size: 36px;
    margin-bottom: 40px;
}

.user-buttons {
    display: flex;
    gap: 30px;
}

.user-btn {
    padding: 20px 50px;
    font-size: 24px;
    background-color: white;
    color: #667eea;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.user-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.user-btn:active {
    transform: translateY(0);
}

/* Chat Screen */
.chat-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f0f2f5;
}

.hidden {
    display: none !important;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-header h2 {
    font-size: 28px;
}

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

.message {
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
    gap: 10px;
}

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

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

.message-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 60px;
}

.message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.message.own .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.other .message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.message-name {
    font-size: 13px;
    color: #65676b;
    font-weight: 600;
    text-transform: capitalize;
}

.message-content {
    display: flex;
    flex-direction: column;
    max-width: 65%;
}

.message-bubble {
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 20px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
}

.message.own .message-bubble {
    background-color: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.other .message-bubble {
    background-color: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-timestamp {
    font-size: 14px;
    color: #65676b;
    margin-top: 5px;
    text-align: right;
}

.message.own .message-timestamp {
    color: rgba(255, 255, 255, 0.8);
}

.typing-indicator {
    padding: 10px 20px;
    color: #65676b;
    font-size: 16px;
    font-style: italic;
}

.input-container {
    display: flex;
    gap: 10px;
    padding: 20px;
    background-color: white;
    border-top: 1px solid #e4e6eb;
}

#message-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 20px;
    border: 1px solid #ccc;
    border-radius: 25px;
    outline: none;
}

#message-input:focus {
    border-color: #667eea;
}

#send-btn {
    padding: 15px 35px;
    font-size: 20px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#send-btn:hover {
    background-color: #5568d3;
}

#send-btn:active {
    background-color: #4651b8;
}

/* Scrollbar styling */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .selection-screen h1 {
        font-size: 28px;
        margin-bottom: 30px;
        padding: 0 20px;
    }

    .user-buttons {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
        width: 100%;
    }

    .user-btn {
        padding: 18px 40px;
        font-size: 22px;
        width: 100%;
        max-width: 300px;
    }

    .chat-header h2 {
        font-size: 24px;
    }

    .messages-container {
        padding: 15px 10px;
    }

    .message-content {
        max-width: 70%;
    }

    .message-bubble {
        font-size: 18px;
        padding: 12px 16px;
    }

    .message-avatar {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .message-avatar-container {
        min-width: 50px;
    }

    .message-name {
        font-size: 12px;
    }

    .input-container {
        padding: 12px 10px;
        gap: 8px;
    }

    #message-input {
        font-size: 18px;
        padding: 12px 16px;
        min-width: 0;
    }

    #send-btn {
        padding: 12px 20px;
        font-size: 18px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .selection-screen h1 {
        font-size: 24px;
    }

    .user-btn {
        font-size: 20px;
        padding: 16px 30px;
    }

    .chat-header h2 {
        font-size: 20px;
    }

    .message-content {
        max-width: 75%;
    }

    .message-bubble {
        font-size: 17px;
        padding: 10px 14px;
    }

    .message-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .message-avatar-container {
        min-width: 45px;
        gap: 3px;
    }

    .message-name {
        font-size: 11px;
    }

    .message-timestamp {
        font-size: 12px;
    }

    #message-input {
        font-size: 17px;
        padding: 10px 14px;
    }

    #send-btn {
        padding: 10px 16px;
        font-size: 17px;
    }

    .typing-indicator {
        font-size: 14px;
        padding: 8px 15px;
    }
}
