* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Noto Sans Bengali', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-box h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.auth-link {
    text-align: center;
    margin-top: 25px;
    color: #666;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.alert {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.alert.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert.success {
    background: #efe;
    color: #383;
    border: 1px solid #cfc;
}

/* Chat Container */
.admin-container {
    display: flex;
    height: 100vh;
    background: white;
}

.user-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
}

/* Sidebar */
.sidebar {
    width: 350px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: white;
}

.sidebar-header h3 {
    color: #333;
    margin-bottom: 10px;
}

.admin-info {
    display: flex;
    flex-direction: column;
}

.admin-info span {
    font-weight: 600;
    color: #333;
}

.admin-info small {
    color: #888;
    font-size: 12px;
}

.users-list {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.users-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.users-header h4 {
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.badge {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.search-box {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.search-box input {
    width: 100%;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.users-scroll {
    flex: 1;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.user-item:hover {
    background: #f0f0f0;
}

.user-item.active {
    background: #e3f2fd;
    border-left: 4px solid #667eea;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.user-details {
    flex: 1;
}

.user-details h5 {
    color: #333;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-details p {
    color: #888;
    font-size: 13px;
    margin-bottom: 2px;
}

.user-details small {
    color: #aaa;
    font-size: 11px;
}

.unread-badge {
    position: absolute;
    right: 20px;
    background: #ff4757;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.logout-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #ff4757;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}

/* Main Chat Area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: white;
}

.chat-partner {
    display: flex;
    align-items: center;
}

.partner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.chat-header h4 {
    color: #333;
    font-weight: 600;
}

.online-status {
    color: #25d366;
    font-size: 13px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f0f2f5;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    text-align: center;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message.sent .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.8;
    text-align: right;
}

.chat-input {
    padding: 20px;
    border-top: 1px solid #eee;
    background: white;
}

.chat-input form {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.chat-input input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s;
}

.chat-input button:hover {
    transform: scale(1.05);
}

/* User Header */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chat-partner-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 40vh;
    }
    
    .user-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}