/* WAI-Core: src/app/static/css/partials/tab/structure.css v3 */
/* File: src/app/static/css/partials/tab/structure.css */

.tab {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 1rem;
  border-radius: var(--brand-border-radius);
  overflow: hidden;
  border: 1px solid var(--tabs-border, var(--brand-color-container-foreground-light));
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  background: linear-gradient(135deg, rgba(17, 29, 38, 0.85), rgba(17, 29, 38, 0.65));
  color: var(--tabs-text, var(--brand-color-container-foreground-light));
  box-shadow: var(--brand-drop-shadow);
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
  position: relative;
  z-index: 1;
  background: rgba(36, 63, 83, 0.85);
  color: var(--tabs-text, var(--brand-color-container-foreground-light));
  border-bottom: 1px solid rgba(46, 217, 231, 0.15);
}

.tab-title {
  flex-grow: 1;
  font-weight: bold;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.tab-clear {
  background: rgba(17, 29, 38, 0.6);
  border: 1px solid var(--tabs-border, var(--brand-color-container-foreground-light));
  font-size: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--tabs-text-muted, rgba(255, 255, 255, 0.65));
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tab-clear:hover {
  background: rgba(46, 217, 231, 0.18);
  color: var(--tabs-text, var(--brand-color-container-foreground-light));
}

.tab-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  background: rgba(17, 29, 38, 0.65);
}

.tab[data-expanded="true"] .tab-body {
  max-height: 500px;
  opacity: 1;
}

.tab-content {
  display: flex;
  width: 100%;
  height: 300px;
  position: relative;
  background: rgba(17, 29, 38, 0.4);
}

.tab-pane {
  padding: 1rem;
  overflow: auto;
  flex: 1;
  color: var(--tabs-text, var(--brand-color-container-foreground-light));
}

.tab-pane-left-content,
.tab-pane-right-content {
  height: 100%;
}

.tab-resize-handle {
  width: 6px;
  min-width: 6px;
  max-width: 6px;
  background: rgba(46, 217, 231, 0.45);
  cursor: col-resize;
  flex-shrink: 0;
  z-index: 1;
}

/* ✅ Animated loading bar for processing state */
.tab-header.loading::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, rgba(46, 217, 231, 0.1), var(--brand-color-primary), rgba(46, 217, 231, 0.1));
  background-size: 200% 100%;
  animation: loading-bar-slide 2s linear infinite;
  z-index: 0;
  opacity: 0.75;
  pointer-events: none;
  border-radius: 0 0 4px 4px;
}

@keyframes loading-bar-slide {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
