/* static/css/components/link.css */
/* Link Component */
.link {
  /* Base link styles */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: var(--font-family);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
  
  /* Auto-sizing */
  width: auto;
  min-width: auto;
}

/* Pill Variant (Button-like) */
.link--pill {
  gap: clamp(0.4rem, 1.5vw, 0.6rem);
  padding: clamp(0.6rem, 2.5vw, 0.8rem) clamp(0.8rem, 3.5vw, 1.2rem);
  border-radius: clamp(2rem, 5vw, 2.8rem);
  border: clamp(0.5px, 0.1vw, 1px) solid #040548;
  background: radial-gradient(50.91% 97.54% at 50% 2.46%, #11127C 0%, #040548 100%);
  color: #ffffff;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  font-weight: 500;
  height: auto;
  min-height: clamp(2rem, 4vw, 2.5rem);
}

.link--pill:hover {
  transform: translateY(-1px);
  box-shadow: 0px clamp(4px, 1vw, 8px) clamp(8px, 2vw, 16px) rgba(4, 5, 72, 0.3);
}

.link--pill:active {
  transform: translateY(0);
}

/* Text Variant (Simple text link) */
.link--text {
  gap: clamp(0.375rem, 1vw, 0.5rem);
  color: #EB1260;
  font-size: clamp(0.875rem, 3vw, 1rem);
  font-weight: 600;
  line-height: 1.5;
  padding: clamp(0.25rem, 1vw, 0.5rem) 0;
}

.link--text:hover {
  color: #C10E52;
  transform: none;
}

.link--text:active {
  color: #A00B44;
}

/* Icon styles */
.link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link__icon svg {
  width: clamp(1rem, 2vw, 1.25rem);
  height: clamp(1rem, 2vw, 1.25rem);
  fill: currentColor;
}

/* Pill variant icon sizing */
.link--pill .link__icon svg {
  width: clamp(0.875rem, 2vw, 1.125rem);
  height: clamp(0.875rem, 2vw, 1.125rem);
}

/* Text variant icon sizing */
.link--text .link__icon svg {
  width: clamp(1rem, 2.5vw, 1.25rem);
  height: clamp(1rem, 2.5vw, 1.25rem);
}

/* Text styles */
.link__text {
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Size variants for pill links */
.link--pill.link--sm {
  font-size: clamp(0.75rem, 2vw, 0.875rem);
  padding: clamp(0.4rem, 2vw, 0.6rem) clamp(0.6rem, 3vw, 0.9rem);
  gap: clamp(0.25rem, 1vw, 0.4rem);
  min-height: clamp(1.5rem, 3vw, 2rem);
}

.link--pill.link--lg {
  font-size: clamp(1rem, 3vw, 1.25rem);
  padding: clamp(0.8rem, 3vw, 1rem) clamp(1rem, 4vw, 1.5rem);
  gap: clamp(0.5rem, 2vw, 0.8rem);
  min-height: clamp(2.5rem, 5vw, 3rem);
}

/* Size variants for text links */
.link--text.link--sm {
  font-size: clamp(0.75rem, 2.5vw, 0.875rem);
  gap: clamp(0.25rem, 0.8vw, 0.375rem);
}

.link--text.link--lg {
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
}

/* Full width variant */
.link--full {
  width: 100%;
}

/* Disabled state */
.link--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* External link indicator (optional) */
.link--external::after {
  content: '';
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.25em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='m7 17 10-10'/%3E%3Cpath d='M7 7h10v10'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.7;
}

/* Focus states */
.link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.link--pill:focus-visible {
  outline-offset: 4px;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .link--pill:hover {
      transform: translateY(-2px);
  }
}

@media (min-width: 1024px) {
  /* Desktop-specific adjustments if needed */
  .link--pill {
      min-width: clamp(120px, 12vw, 180px);
  }
}

/* Theme adjustments */
[data-theme="light"] .link--text {
  color: #EB1260;
}

[data-theme="light"] .link--text:hover {
  color: #C10E52;
}