---
interface Props {
  href: string;
  text: string;
  command?: string;
}

const { href, text, command = 'cd' } = Astro.props;
---

<a 
  href={href}
  class="terminal-view-more-link"
>
  <span class="terminal-view-more-link__prompt">{command}</span>
  <span class="terminal-view-more-link__label">{text}</span>
  <span class="terminal-view-more-link__icon" aria-hidden="true">
    <i class="fas fa-arrow-right text-[10px]"></i>
  </span>
</a>

<style>
  .terminal-view-more-link {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-width: min(100%, 20rem);
    padding: 0.65rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid color-mix(in oklab, var(--primary) 14%, var(--border-color));
    background:
      linear-gradient(180deg, color-mix(in oklab, var(--terminal-bg) 97%, transparent), color-mix(in oklab, var(--header-bg) 88%, transparent)),
      linear-gradient(90deg, rgba(var(--primary-rgb), 0.04), transparent 24%, rgba(var(--primary-rgb), 0.02) 76%, transparent);
    color: var(--title-color);
    text-decoration: none;
    box-shadow:
      0 14px 28px rgba(var(--text-rgb), 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.36);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  }

  .terminal-view-more-link:hover {
    transform: translateY(-1px);
    border-color: color-mix(in oklab, var(--primary) 24%, var(--border-color));
    background:
      linear-gradient(180deg, color-mix(in oklab, var(--terminal-bg) 95%, transparent), color-mix(in oklab, var(--primary) 5%, var(--header-bg))),
      linear-gradient(90deg, rgba(var(--primary-rgb), 0.06), transparent 22%, rgba(var(--primary-rgb), 0.025) 78%, transparent);
    box-shadow:
      0 16px 30px rgba(var(--text-rgb), 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.42);
  }

  .terminal-view-more-link__prompt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in oklab, var(--primary) 10%, var(--terminal-bg));
    color: var(--primary);
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 0.72rem;
    line-height: 1;
    white-space: nowrap;
  }

  .terminal-view-more-link__label {
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
  }

  .terminal-view-more-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 10%, transparent);
  }
</style>
