.snake-tabs {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.snake-tabs__header {
  position: relative;
  border-bottom: 1px solid #3a3a3a;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.snake-tabs__list {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  position: relative;
}

.snake-tabs--default .snake-tabs__list {
  gap: 6px;
  padding-top: 3px;
}

.snake-tabs--default.snake-tabs--full-width .snake-tabs__list {
  gap: 0;
}

.snake-tabs--full-width .snake-tabs__list {
  width: 100%;
  flex-grow: 1;
}

.snake-tabs__tab {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  background-color: transparent;
  border: none;
  color: #8e8e90;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: color var(--transition-base), text-shadow var(--transition-base), background-color var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

.snake-tabs--full-width .snake-tabs__tab {
  flex: 1;
  justify-content: center;
}

/* Sizes */
.snake-tabs--small .snake-tabs__tab {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  min-height: 32px;
}

.snake-tabs--medium .snake-tabs__tab {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  min-height: 40px;
}

.snake-tabs--large .snake-tabs__tab {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-lg);
  min-height: 48px;
}

/* Active state */
.snake-tabs__tab--active {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Hover state */
.snake-tabs__tab:hover:not(:disabled) {
  color: var(--color-text-primary);
  background-color: rgba(31, 29, 32, 0.4);
}

/* Disabled state */
.snake-tabs__tab--disabled,
.snake-tabs__tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Icon */
.snake-tabs__icon {
  display: flex;
  align-items: center;
  font-size: 1.1em;
}

/* Default variant */
.snake-tabs--default .snake-tabs__tab {
  min-width: 120px;
  justify-content: center;
  text-transform: uppercase;
}

.snake-tabs--default .snake-tabs__tab::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 120px;
  height: 4px;
  background-color: #3a3a3a;
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.snake-tabs--default.snake-tabs--full-width .snake-tabs__tab {
  min-width: unset;
}

.snake-tabs--default.snake-tabs--full-width .snake-tabs__tab::before {
  max-width: 100%;
  width: 100%;
  left: 0;
  transform: none;
}

.snake-tabs--default .snake-tabs__tab--active::before {
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Boxed variant */
.snake-tabs--boxed .snake-tabs__header {
  border-bottom: none;
  padding: var(--spacing-xs);
  background-color: rgba(16, 16, 16, 0.4);
  border: 1px solid #3a3a3a;
}

.snake-tabs--boxed .snake-tabs__list {
  gap: 0;
}

.snake-tabs--boxed .snake-tabs__tab {
  border: 1px solid transparent;
  margin: 0;
}

.snake-tabs--boxed .snake-tabs__tab--active {
  background-color: #101010;
  border-color: #3a3a3a;
  border-bottom-color: #101010;
  margin-bottom: -1px;
  z-index: 1;
}

.snake-tabs--boxed .snake-tabs__content {
  border: 1px solid #3a3a3a;
  border-top: none;
  background-color: #101010;
}

/* Underline variant */
.snake-tabs--underline .snake-tabs__header {
  border-bottom: 2px solid #3a3a3a;
}

.snake-tabs--underline .snake-tabs__tab {
  padding-bottom: calc(var(--spacing-sm) + 2px);
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
}

.snake-tabs--underline .snake-tabs__tab--active {
  border-bottom-color: var(--color-text-primary);
}

.snake-tabs--underline .snake-tabs__tab:hover:not(:disabled) {
  background-color: transparent;
  border-bottom-color: rgba(189, 189, 189, 0.5);
}

/* Content */
.snake-tabs__content {
  padding: var(--spacing-lg);
  background-color: transparent;
}

.snake-tabs__panel {
  display: none;
  animation: fadeIn var(--transition-fast);
}

.snake-tabs__panel--active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus state */
.snake-tabs__tab:focus {
  outline: none;
}

/* Arrow buttons */
.snake-tabs__arrow {
  background-color: transparent;
  border: none;
  color: #8e8e90;
  font-size: 28px;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  padding: 0;
}

/* Arrow button sizes */
.snake-tabs--small .snake-tabs__arrow {
  width: 36px;
  height: 36px;
  font-size: 24px;
}

.snake-tabs--medium .snake-tabs__arrow {
  width: 40px;
  height: 40px;
  font-size: 28px;
}

.snake-tabs--large .snake-tabs__arrow {
  width: 44px;
  height: 44px;
  font-size: 32px;
}

.snake-tabs__arrow:hover {
  color: var(--color-text-primary);
  background-color: rgba(31, 29, 32, 0.4);
}

.snake-tabs__arrow:active {
  transform: scale(0.95);
}

.snake-tabs__arrow:focus {
  outline: none;
}

.snake-tabs__arrow--left {
  margin-right: var(--spacing-xs);
}

.snake-tabs__arrow--right {
  margin-left: var(--spacing-xs);
}

/* Align arrows with tabs for default variant */
.snake-tabs--default .snake-tabs__arrow {
  margin-bottom: 6px;
}

/* Remove flex-grow so tabs don't stretch */
.snake-tabs__list {
  flex-grow: 0;
}

/* Corner decorations for boxed variant */
.snake-tabs--boxed .snake-tabs__header::before,
.snake-tabs--boxed .snake-tabs__header::after,
.snake-tabs--boxed .snake-tabs__content::before,
.snake-tabs--boxed .snake-tabs__content::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid #8e8e90;
}

.snake-tabs--boxed .snake-tabs__header::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.snake-tabs--boxed .snake-tabs__header::after {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.snake-tabs--boxed .snake-tabs__content::before {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

.snake-tabs--boxed .snake-tabs__content::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}
