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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.chat-header .info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header .info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #b9bccc 0%, #d8daf3 100%);
}

div.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

div.message.sent {
    justify-content: flex-end;
}

div.message.received {
    justify-content: flex-start;
}

div.message-content {
    max-width: 70%;
    display: flex;
    align-items: flex-start;
}

.sent div.message-content {
    flex-direction: row-reverse;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    margin: 0 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.avatar.sender {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.avatar.receiver {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

div.message-bubble {
    position: relative;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 100%;
    word-wrap: break-word;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.sent div.message-bubble {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.received div.message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

div.message-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sent div.message-info {
    align-items: flex-end;
}

.sender-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.8;
}

.sent .sender-name {
    color: rgba(255,255,255,0.8);
}

.received .sender-name {
    color: #666;
}

div.message-text {
    line-height: 1.4;
    font-size: 14px;
}

div.message-time {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.6;
}

.sent div.message-time {
    color: rgba(255,255,255,0.7);
}

.received div.message-time {
    color: #999;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 0;
    font-style: italic;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

.typing-dots {
    display: inline-flex;
    margin-left: 8px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    display: inline-block;
    margin: 0 1px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-input {
    background: white;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.chat-input input:focus {
    border-color: #007bff;
}

.send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #007bff;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.send-btn:hover {
    background: #0056b3;
}

/* Responsive */
@media (max-width: 768px) {
    div.message-content {
        max-width: 85%;
    }

    .chat-container {
        padding: 15px;
    }

    .avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}