.snake-textarea-wrapper {
  display: inline-flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  font-family: var(--font-family);
  width: 100%;
  max-width: 400px;
}

.snake-textarea-wrapper--full-width {
  max-width: none;
}

/* Label */
.snake-textarea__label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Container */
.snake-textarea__container {
  position: relative;
  width: 100%;
}

/* Textarea */
.snake-textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--spacing-md);
  background-color: #1a1a1c;
  border: 1px solid #3a3a3a;
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  resize: vertical;
  transition: all var(--transition-fast);
}

.snake-textarea:focus {
  outline: none;
  border-color: var(--color-text-primary);
  background-color: #101010;
}

.snake-textarea:hover:not(:disabled) {
  border-color: #4a4a4a;
}

/* Placeholder */
.snake-textarea::placeholder {
  color: #6a6a6c;
}

/* Auto-resize */
.snake-textarea--auto-resize {
  overflow-y: hidden;
}

/* Sizes */
.snake-textarea-wrapper--small .snake-textarea {
  padding: var(--spacing-sm);
  font-size: var(--font-size-sm);
  min-height: 60px;
}

.snake-textarea-wrapper--large .snake-textarea {
  padding: var(--spacing-lg);
  font-size: var(--font-size-lg);
  min-height: 100px;
}

/* Variants */
.snake-textarea--default {
  background-color: #1a1a1c;
  border-color: #3a3a3a;
}

.snake-textarea--ghost {
  background-color: transparent;
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}

.snake-textarea--ghost:focus {
  background-color: #1a1a1c;
  border-color: #3a3a3a;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

.snake-textarea--bordered {
  background-color: transparent;
  border-width: 2px;
}

/* Footer */
.snake-textarea__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 20px;
}

/* Helper text */
.snake-textarea__helper {
  font-size: var(--font-size-sm);
  color: #8e8e90;
}

/* Error state */
.snake-textarea-wrapper--error .snake-textarea {
  border-color: var(--color-danger);
}

.snake-textarea-wrapper--error .snake-textarea:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(255, 85, 85, 0.2);
}

.snake-textarea__error {
  font-size: var(--font-size-sm);
  color: var(--color-danger);
}

/* Character count */
.snake-textarea__count {
  font-size: var(--font-size-sm);
  color: #6a6a6c;
  font-variant-numeric: tabular-nums;
}

.snake-textarea__count--limit {
  color: var(--color-warning);
}

.snake-textarea__count--exceeded {
  color: var(--color-danger);
}

/* Disabled state */
.snake-textarea-wrapper--disabled {
  opacity: 0.5;
}

.snake-textarea:disabled {
  cursor: not-allowed;
  resize: none;
}

/* Corner decorations */
.snake-textarea__corner {
  position: absolute;
  width: 6px;
  height: 6px;
  border: 1px solid #8e8e90;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.snake-textarea:focus ~ .snake-textarea__corner {
  opacity: 0.6;
}

.snake-textarea__corner--top-left {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.snake-textarea__corner--top-right {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.snake-textarea__corner--bottom-left {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

.snake-textarea__corner--bottom-right {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

/* Scrollbar styling */
.snake-textarea::-webkit-scrollbar {
  width: 8px;
}

.snake-textarea::-webkit-scrollbar-track {
  background-color: #101010;
  border-left: 1px solid #3a3a3a;
}

.snake-textarea::-webkit-scrollbar-thumb {
  background-color: #4a4a4a;
  border-radius: 0;
}

.snake-textarea::-webkit-scrollbar-thumb:hover {
  background-color: #5a5a5a;
}

/* Selection */
.snake-textarea::selection {
  background-color: rgba(189, 189, 189, 0.3);
  color: var(--color-text-primary);
}

/* Focus glow effect */
.snake-textarea:focus {
  box-shadow:
    inset 0 0 0 1px var(--color-text-primary),
    0 0 12px rgba(189, 189, 189, 0.1);
}
