/* =============================================================================
   Tabbed Content Block
   ============================================================================= */

/* CSS custom properties for styling (set via inline style on section) */
.tabbed-content-block {
  --tc-accent: #0d6efd;
  --tc-text: #6c757d;
  --tc-hover: #495057;
}

/* --- Default: Underline variant --- */
.tabbed-content-block .nav-tabs {
  border-bottom: 2px solid #dee2e6;
  gap: 0;
}

.tabbed-content-block .nav-tabs .nav-link {
  border: none;
  color: var(--tc-text, #6c757d);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  position: relative;
  background: transparent;
  transition: color 0.2s ease;
  border-radius: 0;
  margin-bottom: -2px;
}

.tabbed-content-block .nav-tabs .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: transparent;
  transition: background-color 0.2s ease;
}

.tabbed-content-block .nav-tabs .nav-link:hover {
  color: var(--tc-hover, #495057);
  border: none;
}

.tabbed-content-block .nav-tabs .nav-link.active {
  color: var(--tc-accent, #0d6efd);
  background: transparent;
  border: none;
}

.tabbed-content-block .nav-tabs .nav-link.active::after {
  background: var(--tc-accent, #0d6efd);
}

/* --- Pills variant --- */
.tabbed-content-block .nav-pills .nav-link {
  color: var(--tc-text, #6c757d);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.tabbed-content-block .nav-pills .nav-link:hover {
  color: var(--tc-hover, #495057);
  background: rgba(0, 0, 0, 0.05);
}

.tabbed-content-block .nav-pills .nav-link.active {
  color: #fff;
  background: var(--tc-accent, #0d6efd);
}

/* --- Buttons variant --- */
.tabbed-content-block .nav-tabs.tc-variant-buttons {
  border-bottom: none;
  gap: 0.5rem;
}

.tabbed-content-block .nav-tabs.tc-variant-buttons .nav-link {
  border: 1px solid #dee2e6;
  border-radius: var(--app-radius, 8px);
  color: var(--tc-text, #6c757d);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  margin-bottom: 0;
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.tabbed-content-block .nav-tabs.tc-variant-buttons .nav-link::after {
  display: none;
}

.tabbed-content-block .nav-tabs.tc-variant-buttons .nav-link:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

.tabbed-content-block .nav-tabs.tc-variant-buttons .nav-link.active {
  color: #fff;
  background: var(--tc-accent, #0d6efd);
  border-color: var(--tc-accent, #0d6efd);
}

/* --- Bordered variant --- */
.tabbed-content-block .nav-tabs.tc-variant-bordered {
  border-bottom: none;
  gap: 0;
}

.tabbed-content-block .nav-tabs.tc-variant-bordered .nav-link {
  border: 1px solid transparent;
  border-bottom: 1px solid #dee2e6;
  border-radius: var(--app-radius, 8px) var(--app-radius, 8px) 0 0;
  color: var(--tc-text, #6c757d);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  margin-bottom: -1px;
  background: transparent;
  transition: all 0.2s ease;
}

.tabbed-content-block .nav-tabs.tc-variant-bordered .nav-link::after {
  display: none;
}

.tabbed-content-block .nav-tabs.tc-variant-bordered .nav-link:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: #e9ecef #e9ecef #dee2e6;
}

.tabbed-content-block .nav-tabs.tc-variant-bordered .nav-link.active {
  color: var(--tc-accent, #0d6efd);
  background: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
}

/* --- Shared --- */
.tabbed-content-block .tab-content {
  padding: 1.5rem 0;
}

.tabbed-content-block .tab-pane {
  animation: tabFadeIn 0.3s ease;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tab preview in builder - drop zone area */
.tabbed-content-block .tab-pane .tab-blocks-area {
  min-height: 60px;
  border: 2px dashed transparent;
  border-radius: var(--app-radius, 8px);
  padding: 0.5rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.tabbed-content-block .tab-pane .tab-blocks-area.tab-blocks-area--empty {
  border-color: #dee2e6;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 0.875rem;
  min-height: 80px;
}

.tabbed-content-block .tab-pane .tab-blocks-area.tab-blocks-area--empty::before {
  content: '\2B07';
  font-size: 1.25rem;
  margin-right: 0.4rem;
  opacity: 0.5;
}

.tabbed-content-block .tab-pane .tab-blocks-area.tab-blocks-area--drag-over {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.06);
  border-style: solid;
  box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.15);
}

/* Blocks inside tab panes inherit their own styling from their block CSS */

/* Wrapper for each referenced block inside a tab */
.tabbed-content-block .tab-block-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
  border-radius: var(--app-radius, 6px);
  transition: box-shadow 0.15s ease;
}

.tabbed-content-block .tab-block-wrapper:hover {
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
  cursor: pointer;
}

/* Controls overlay inside tab blocks */
.tabbed-content-block .tab-block-controls {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tabbed-content-block .tab-block-wrapper:hover .tab-block-controls {
  opacity: 1;
}

/* Tab label in the builder inspector */
.tabbed-content-editor .tab-row {
  border: 1px solid #dee2e6;
  border-radius: var(--app-radius, 8px);
  margin-bottom: 0.75rem;
}

.tabbed-content-editor .tab-row .tab-header-row {
  cursor: move;
}
