/* ---------------------------------------- */
/*  Tab Bar                                 */
/* ---------------------------------------- */

.custom-chat-tabs-bar {
  align-items: center;
  border-bottom: 1px solid var(--color-shadow-primary);
  box-sizing: border-box;
  display: flex;
  padding: 4px 0 0 0;
  pointer-events: all;
  width: 100%;
}

.custom-chat-tabs-list {
  display: flex;
  flex: 1;
  gap: 0.25rem;
  overflow: hidden;
  padding: 0 4px;
}

/* ---------------------------------------- */
/*  Scroll Arrows                           */
/* ---------------------------------------- */

.custom-chat-tabs-arrow {
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  display: none;
  flex: 0 0 auto;
  font-size: var(--font-size-14);
  justify-content: center;
  padding: 0;
  width: 20px;
}

.custom-chat-tabs-arrow.visible {
  display: flex;
}

/* ---------------------------------------- */
/*  Tabs                                    */
/* ---------------------------------------- */

.custom-chat-tabs-tab {
  align-items: center;
  background: var(--control-bg-color);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  display: inline-flex;
  font-size: var(--font-size-12);
  gap: 0.25rem;
  margin-top: 1px;
  padding: 4px 8px;
  position: relative;
  white-space: nowrap;
  width: auto;
  height: auto;
}

.custom-chat-tabs-tab:hover {
  background: var(--control-hover-bg-color);
  border: 1px solid var(--control-hover-border-color);
  border-bottom: none;
}

.custom-chat-tabs-tab.active,
.custom-chat-tabs-tab.active:hover {
  background: var(--control-active-border-color);
  border: 1px solid transparent;
  border-bottom: none;
}

/* ---------------------------------------- */
/*  Chat Log                                */
/* ---------------------------------------- */

/* Temporary fix of https://github.com/foundryvtt/foundryvtt/issues/14358 */
ol.chat-log:has(> li:nth-of-type(100)) {
  padding-left: 0;
}

/* ---------------------------------------- */
/*  Pin Indicator                           */
/* ---------------------------------------- */

.custom-chat-tabs-pin-icon {
  align-content: center;
  flex: 0;
  min-width: 20px;
}

/* ---------------------------------------- */
/*  Notification Pips                     */
/* ---------------------------------------- */

.custom-chat-tabs-pip {
  background: white;
  border-radius: 50%;
  display: none;
  height: 8px;
  position: absolute;
  right: -2px;
  top: -2px;
  width: 8px;
}

.custom-chat-tabs-pip.active {
  display: block;
}

/* ---------------------------------------- */
/*  Tab Config Form                        */
/* ---------------------------------------- */

.custom-chat-tabs-config {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.5rem;
}

.custom-chat-tabs-config-panels {
  display: flex;
  flex: 1;
  gap: 0.5rem;
  min-height: 0;
}

.custom-chat-tabs-config-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.custom-chat-tabs-config-panel h3 {
  font-size: var(--font-size-14);
  margin: 0 0 0.25rem 0;
  text-align: center;
}

.custom-chat-tabs-config-list {
  border: 1px solid var(--color-fieldset-border);
  border-radius: 4px;
  flex: 1;
  list-style: none;
  margin: 0;
  overflow-y: auto;
  padding: 0.25rem;
}

.custom-chat-tabs-config-item {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  gap: 0.25rem;
  padding: 4px 6px;
}

.custom-chat-tabs-config-item.highlighted,
.custom-chat-tabs-config-item:hover {
  background: var(--button-background-color);
  border-color: var(--button-border-color);
}

.custom-chat-tabs-config-item.dragging {
  opacity: 0.4;
}

.custom-chat-tabs-config-item.drag-over-top {
  border-top: 2px solid var(--color-shadow-primary);
}

.custom-chat-tabs-config-item.drag-over-bottom {
  border-bottom: 2px solid var(--color-shadow-primary);
}

.custom-chat-tabs-config-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-chat-tabs-config-original {
  font-size: var(--font-size-11);
  opacity: 0.6;
}

.custom-chat-tabs-config-external-icon {
  flex: 0;
}

.custom-chat-tabs-config-edit {
  background: none;
  border: none;
  cursor: pointer;
  flex: 0;
  padding: 2px 4px;
}

.custom-chat-tabs-config-edit:hover {
  opacity: 1;
}

.custom-chat-tabs-config-controls {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
}

.custom-chat-tabs-config-controls button {
  align-items: center;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.custom-chat-tabs-config .form-footer {
  margin-top: 0.5rem;
}

/* ---------------------------------------- */
/*  Tab Edit Form                          */
/* ---------------------------------------- */

.custom-chat-tabs-edit .form-group {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.custom-chat-tabs-edit .form-group label {
  flex: 0 0 80px;
}

.custom-chat-tabs-edit .form-group input[type="text"] {
  flex: 1;
}

.custom-chat-tabs-edit .form-group input[type="checkbox"] {
  flex: 0;
}