/* Container */
#ftb-app, #ftb-admin {
  border: 1px solid #ccc;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  max-width: 100%;
  direction: rtl;
  text-align: right;
  margin-left: auto;
  margin-right: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Form inputs */
#ftb-form input,
#ftb-form select {
  margin: 5px 8px 5px 0;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: all 0.2s;
}

#ftb-form input:focus,
#ftb-form select:focus {
  border-color: #007BFF;
  box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

/* Form buttons */
#ftb-form button {
  margin: 5px 8px 5px 0;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
  background-color: #0069d9; /* nicer blue */
  color: #fff;
}

#ftb-form button:hover {
  background-color: #0056b3;
}

/* Cancel button */
#ftb-cancel {
  background-color: #e74c3c; /* brighter red */
}

#ftb-cancel:hover {
  background-color: #c0392b;
}

/* Export buttons */
#ftb-exports,
#ftb-admin #ftb-user-tree #ftb-exports {
  margin-top: 15px;
}

#ftb-exports button {
  margin-right: 10px;
  margin-bottom: 6px;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  background-color: #28a745; /* green */
  color: #fff;
  transition: all 0.2s;
}

#ftb-exports button:hover {
  background-color: #218838;
}

/* Member boxes */
.member-box {
  font-weight: 600;
  display: inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f9f9f9;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all 0.2s;
}

.member-box:hover {
  background: #e9f0ff;
  border-color: #007BFF;
}

/* Member actions */
.member-actions button {
  margin-left: 8px;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.member-actions .add-child {
  background-color: #17a2b8; /* teal */
  color: #fff;
}

.member-actions .add-child:hover {
  background-color: #117a8b;
}

.member-actions .delete {
  background-color: #e74c3c; /* bright red */
  color: #fff;
}

.member-actions .delete:hover {
  background-color: #c0392b;
}

/* Counts */
#ftb-counts {
  margin-bottom: 15px;
  font-weight: bold;
  color: #333;
}

/* Tree styling */
#ftb-members ul, #ftb-admin #ftb-user-tree ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

/* User/Tree expand toggle */
.toggle {
  font-weight: bold;
  cursor: pointer;
  margin-left: 6px;
}

/* Admin user buttons */
.ftb-user-block button {
  padding: 6px 12px;
  border-radius: 6px;
  background: #17a2b8;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 5px;
  transition: all 0.2s;
}

.ftb-user-block button:hover {
  background: #117a8b;
}

/* Admin export buttons inside user tree */
#ftb-user-tree #ftb-exports button {
  margin-bottom: 6px;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  background-color: #28a745;
  color: #fff;
  transition: all 0.2s;
}

#ftb-user-tree #ftb-exports button:hover {
  background-color: #218838;
}

/* Tree connectors */
#ftb-members ul {
  position: relative;
  padding-right: 40px; /* extra space for RTL connectors */
  margin: 0;
}

#ftb-members ul::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0; /* stops at last child */
  right: 15px; /* RTL alignment */
  width: 0;
  border-right: 2px solid #ccc;
}

#ftb-members li {
  position: relative;
  margin: 0;
  padding: 0 20px 0 0; /* space for connector */
  list-style: none;
}

#ftb-members li::before {
  content: '';
  position: absolute;
  top: 18px; /* aligns with middle of member box */
  right: 0;
  width: 20px;
  border-top: 2px solid #ccc;
}

#ftb-members li:last-child::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 15px;
  bottom: 0;
  border-right: 2px solid white; /* hides vertical line beyond last child */
}

select[name="color"] option {
  padding-left: 25px; /* space for the circle */
  position: relative;
}

select[name="color"] option::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  background-color: currentColor;
}

