/* Tabs Container */
.tabs-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-family: var(--font-family, system-ui, -apple-system, sans-serif);
}

.tabs-container .tabs-container {
  margin-top: 1rem;
}

.tabs-container .tabs-container .tabs-header {
  border-bottom-style: dashed;
}

/* Tabs Header */
.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  margin-bottom: 1rem;
  gap: 0.25rem;
}

.tabs-header {
  flex-direction: column;
  gap: 0.5rem;
}

/* Tab Button Base Styles */
.tab-button {
  padding: 0.75rem 1rem;
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 500;
  color: var(--text-color-secondary, #6b7280);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  width: 100%;
  text-align: center;
}

.tab-button:hover:not(:disabled) {
  color: var(--text-color-primary, #374151);
}

.tab-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tab-button.active {
  color: var(--primary);
}

/* Focus States */
.tab-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent);
}

.tab-button:focus:not(:focus-visible) {
  box-shadow: none;
}

/* Tab Content */
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

.tabs-contents {
  padding: 0.3rem;
  height: 100%;
  width: 100%;
  background-color: var(--background-color-light, #c9e0e7);
}

.tab-contents {
  display: none;
  visibility: hidden;
}

.tab-contents.active {
  width: 99%;
  visibility: visible;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-right: 0;
  padding-right: 0;
}

/* Variants */
.tabs-default .tab-button {
  border-radius: var(--border-radius-md, 0.375rem);
}

.tabs-default .tab-button:hover:not(:disabled) {
  background-color: var(--background-color-hover, #f3f4f6);
}

.tabs-default .tab-button.active {
  background-color: var(--background-color-active, #eff6ff);
}

.tabs-underline .tab-button {
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs-underline .tab-button.active {
  border-bottom-color: var(--primary);
}

.tabs-pills .tab-button {
  border-radius: var(--border-radius-full, 9999px);
  padding: 0.5rem 1rem;
}

.tabs-pills .tab-button:hover:not(:disabled) {
  background-color: var(--background-color-hover, #f3f4f6);
}

.tabs-pills .tab-button.active {
  background-color: var(--primary);
  color: var(--text-color-light, #fff);
}

.tabs-bordered .tab-button {
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--border-radius-md, 0.375rem) var(--border-radius-md, 0.375rem) 0 0;
  margin-bottom: -1px;
}

.tabs-bordered .tab-button.active {
  border-color: var(--border-color, #e5e7eb);
  border-bottom-color: var(--background-color, #fff);
  background-color: var(--background-color, #fff);
}

/* Size Variants */
.tabs-sm .tab-button {
  padding: 0.5rem 0.75rem;
  font-size: var(--font-size-xs, 0.75rem);
}

.tabs-lg .tab-button {
  padding: 1rem 1.5rem;
  font-size: var(--font-size-lg, 1rem);
}

/* Alignment Variants */
.tabs-start .tabs-header {
  justify-content: flex-start;
}

.tabs-center .tabs-header {
  justify-content: center;
}

.tabs-end .tabs-header {
  justify-content: flex-end;
}

.tabs-stretch .tabs-header {
  justify-content: stretch;
}

.tabs-stretch .tab-button {
  flex: 1;
}

/* Content Grid */
.tab-content-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem 0;
}

/* Loading and Error States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-color-secondary, #6b7280);
}

.error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--error-color, #dc2626);
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 640px) {
  .tabs-header {
    display: none;
  }

  .tab-panel {
    display: block !important;
    page-break-inside: avoid;
  }

  .tab-panel::before {
    content: attr(aria-label);
    font-weight: 700;
    font-size: 1.2em;
    margin-bottom: 1rem;
    display: block;
  }
}

/* High Contrast Mode */
@media (forced-colors: active) {
  .tab-button.active {
    border: 2px solid;
  }
}

