/* General Styles for the User Management Section */
#user-management {
    font-family: 'Vazirmatn', Arial, sans-serif;
    direction: rtl; /* For right-to-left languages */
    max-width: 900px;
    margin: 20px auto;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

body {
    background-color: #f0f2f5;
}

#user-management h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
    position: relative;
}

#user-management h3::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2c3e50);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* Form for Adding Users */
#add-user-form {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px;
    margin-bottom: 30px;
    padding: 25px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#add-user-form input,
#add-user-form select {
    flex-grow: 1; /* Allow fields to grow and fill space */
    min-width: 180px; /* Minimum width for each field */
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Vazirmatn', Arial, sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#add-user-form button {
    flex-grow: 1;
    min-width: 180px;
    padding: 14px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#add-user-form input:focus,
#add-user-form select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

#add-user-form button:hover {
    background-color: #34495e;
    transform: translateY(-2px);
}

/* Users Table */
#users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#users-table th,
#users-table td {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

#users-table thead th {
    background-color: #34495e;
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
}

#users-table tbody tr:last-child td {
    border-bottom: none;
}

#users-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.3s ease;
}

/* Action Buttons */
#users-table button {
    padding: 10px 15px;
    margin: 0 5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: 'Vazirmatn', Arial, sans-serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edit-btn {
    background-color: #3498db;
    color: #fff;
}

.edit-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.deactivate-btn {
    background-color: #e74c3c;
    color: #fff;
}

.deactivate-btn:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* Status Indicators */
#users-table .online {
    color: #2ecc71;
    font-weight: bold;
}

#users-table .offline {
    color: #95a5a6;
}

/* Responsive Design */
@media (max-width: 768px) {
    #user-management {
        padding: 15px;
        margin: 10px;
    }
    
    #add-user-form {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    #add-user-form input,
    #add-user-form select,
    #add-user-form button {
        width: 100%;
        min-width: auto;
    }

    /* Table styles for mobile */
    #users-table {
        border-radius: 8px;
    }

    #users-table thead {
        display: none; /* Hide header on mobile */
    }

    #users-table,
    #users-table tbody,
    #users-table tr {
        display: block;
        width: 100%;
    }

    #users-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    #users-table td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
    }

    #users-table td:before {
        content: attr(data-label);
        position: absolute;
        right: 15px;
        width: 45%;
        text-align: left;
        font-weight: bold;
        color: #555;
    }

    #users-table td:nth-of-type(1):before { content: "ID"; }
    #users-table td:nth-of-type(2):before { content: "نام کاربری"; }
    #users-table td:nth-of-type(3):before { content: "نقش"; }
    #users-table td:nth-of-type(4):before { content: "آنلاین/آفلاین"; }
    #users-table td:nth-of-type(5):before { content: "عملیات"; }

    #users-table td:last-of-type {
        text-align: center;
        padding-left: 15px;
    }
}