{{!-- 
  Subscription Status Partial - Display current subscription info
  Usage: {{> subscription-status}}
--}}
<div class="subscription-status">
  {{#hasActiveSubscription}}
  <div class="subscription-status-active">
    <div class="status-badge active">
      <span class="status-dot"></span>
      Active
    </div>
    <div class="status-details">
      <div class="status-plan">
        <span class="label">Current Plan</span>
        <span class="value">{{subscription.planName}}</span>
      </div>
      {{#if subscription.expiresAt}}
      <div class="status-renewal">
        <span class="label">Renews</span>
        <span class="value">{{formatDate subscription.expiresAt}}</span>
      </div>
      {{/if}}
    </div>
    <div class="status-actions">
      <a href="/admin/subscription" class="btn-manage">Manage Subscription</a>
    </div>
  </div>
  {{else}}
  <div class="subscription-status-inactive">
    <div class="status-badge inactive">
      <span class="status-dot"></span>
      Free Plan
    </div>
    <div class="status-message">
      <p>You're on the free plan with limited features.</p>
      <p>Upgrade to unlock premium capabilities.</p>
    </div>
    <div class="status-actions">
      <a href="/admin/pricing" class="btn-upgrade">Upgrade Now</a>
    </div>
  </div>
  {{/hasActiveSubscription}}
</div>

<style>
.subscription-status {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.subscription-status-active,
.subscription-status-inactive {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  width: fit-content;
}
.status-badge.active {
  background: #dcfce7;
  color: #166534;
}
.status-badge.inactive {
  background: #f1f5f9;
  color: #64748b;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-badge.active .status-dot {
  background: #22c55e;
  animation: pulse 2s infinite;
}
.status-badge.inactive .status-dot {
  background: #94a3b8;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.status-details {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.status-plan,
.status-renewal {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.status-details .label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-details .value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
}
.status-message p {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}
.status-actions {
  margin-top: 0.5rem;
}
.btn-manage,
.btn-upgrade {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-manage {
  background: #f1f5f9;
  color: #475569;
}
.btn-manage:hover {
  background: #e2e8f0;
}
.btn-upgrade {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
}
.btn-upgrade:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
</style>

