* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 700px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.connection-info {
    display: flex;
    gap: 20px;
    font-size: 13px;
    opacity: 0.9;
}

.connection-info span {
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #f8f9fa;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 75%;
    word-wrap: break-word;
    position: relative;
    animation: fadeIn 0.3s ease-in;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 6px;
}

.message.other {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 6px;
}

.message.system {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
    text-align: center;
    max-width: 90%;
    font-style: italic;
    border-radius: 12px;
    margin: 10px auto;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 6px;
    text-align: right;
    font-weight: 500;
}

.message.user .message-time {
    text-align: right;
    color: rgba(255,255,255,0.8);
}

.message.other .message-time {
    text-align: left;
    color: #666;
}

.message.system .message-time {
    display: none;
}

.chat-input {
    padding: 20px 25px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.chat-input input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chat-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .chat-header h1 {
        font-size: 18px;
    }
    
    .connection-info {
        font-size: 12px;
        gap: 15px;
    }
    
    .chat-messages {
        padding: 20px;
    }
    
    .chat-input {
        padding: 15px 20px;
    }
}
