/* css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
    background: #f0f2f5;
    direction: rtl;
}

/* تسجيل الدخول */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    text-align: center;
}

.login-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #0084ff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}

.error {
    background: #ffe0e0;
    color: #d00;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* واجهة المحادثة */
.chat-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 300px;
    background: #fff;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    background: #0084ff;
    color: white;
    text-align: center;
}

.user-list {
    flex: 1;
    overflow-y: auto;
}

.user-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-item:hover {
    background: #f5f5f5;
}

.user-item.active {
    background: #e3f2fd;
}

.user-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #4caf50;
}

.status-dot.offline {
    background: #ccc;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

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

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

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
}

.sent .message-content {
    background: #0084ff;
    color: white;
    border-bottom-left-radius: 5px;
}

.received .message-content {
    background: #e4e6eb;
    color: #333;
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
}

.message-status {
    font-size: 12px;
    text-align: left;
}

.message-input {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.message-input textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    height: 45px;
    font-size: 14px;
}

.message-input button {
    padding: 10px 20px;
    background: #0084ff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.file-label {
    padding: 10px;
    background: #e4e6eb;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
}

/* لوحة المدير */
.admin-container {
    max-width: 1200px;
    margin: 30px auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: 40vh;
    }
}