* {
    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;
}

.auth-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.auth-container input,
.auth-container textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.auth-container button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-container button:hover {
    background: #5a67d8;
}

.alert {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert.error {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.chat-container {
    display: flex;
    width: 100%;
    height: 100vh;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar {
    width: 350px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
}

.wallet-info {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 14px;
}

.friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.friend-search {
    display: flex;
    margin-bottom: 1rem;
}

.friend-search input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
}

.friend-search button {
    padding: 0.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.friend-item:hover,
.friend-item.active {
    background: #f8f9fa;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1rem;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.friend-info {
    display: flex;
    align-items: center;
}

.messages-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 1rem;
    max-width: 70%;
}

.message.sent {
    margin-left: auto;
}

.message.sent p {
    background: #667eea;
    color: white;
}

.message.received p {
    background: white;
    color: #333;
}

.message p {
    padding: 0.75rem;
    border-radius: 15px;
    margin-bottom: 0.25rem;
}

.message img,
.message video {
    max-width: 300px;
    border-radius: 10px;
}

.message .time {
    font-size: 12px;
    color: #666;
}

.message-input {
    padding: 1rem;
    border-top: 1px solid #eee;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 25px;
}

.input-group button {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
}

@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 40%;
    }
    
    .chat-area {
        height: 60%;
    }
}