/* ============================================================
   MiniMKT Links — Shared Styles
   Used by: linktree main page, vendor vCard pages
   ============================================================ */

/* --- Reset / Normalize --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* --- Design Tokens --- */
:root {
  /* Colors */
  --color-bg:        #090b0a;
  --color-surface:   #111312;
  --color-border:    rgba(255, 255, 255, 0.15);
  --color-border-hover: rgba(89, 172, 115, 0.6);
  --color-text:      #e8e6d9;
  --color-text-muted: rgba(232, 230, 217, 0.45);
  --color-green:     #59AC73;
  --color-green-glow: rgba(89, 172, 115, 0.25);
  --color-gold:      #F9BB1C;
  --color-gold-glow: rgba(249, 187, 28, 0.2);

  /* Typography */
  --font-display: 'Urbanist', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radii */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-med:  0.35s var(--ease-out);
}

/* --- Base --- */
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* --- Layout --- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: var(--space-2xl) var(--space-md) var(--space-lg);
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Typography --- */
.text-display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
}

.text-body {
  font-family: var(--font-body);
  font-weight: 400;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-green {
  color: var(--color-green);
}

.text-gold {
  color: var(--color-gold);
}

.text-center {
  text-align: center;
}

/* --- Logo --- */
.logo {
  display: block;
  margin: 0 auto var(--space-md);
}

/* --- Tagline --- */
.tagline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-2xl);
  letter-spacing: 0.01em;
}

/* --- Link Buttons --- */
.links-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.link-btn {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  width: 100%;
  padding: 18px 20px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #161917 0%, #111312 100%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  color: var(--color-text);
  font-family: var(--font-body);
  transition:
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    background var(--transition-fast);
  cursor: pointer;
}

.link-btn:hover,
.link-btn:focus-visible {
  background: linear-gradient(145deg, #1a1f1c 0%, #141816 100%);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 24px var(--color-green-glow),
    0 1px 0 rgba(89, 172, 115, 0.15) inset;
  transform: translateY(-2px);
}

.link-btn:active {
  transform: translateY(0);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.link-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(89, 172, 115, 0.15) 0%, rgba(89, 172, 115, 0.06) 100%);
  color: var(--color-green);
}

.link-btn-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.link-btn-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.link-btn-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.link-btn-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.3;
}

.link-btn-arrow {
  flex-shrink: 0;
  opacity: 0.15;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  font-size: 24px;
  line-height: 1;
  font-weight: 300;
}

.link-btn:hover .link-btn-arrow {
  opacity: 0.5;
  transform: translateX(3px);
}

/* --- Card Container (reusable for vCard) --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* --- Action Buttons (reusable) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  transition:
    background-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-green);
  color: #fff;
}

.btn-primary:hover {
  box-shadow: 0 0 24px var(--color-green-glow);
  transform: scale(1.02);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 0 16px var(--color-green-glow);
}

.btn-gold {
  background-color: var(--color-gold);
  color: #1a1a1a;
}

.btn-gold:hover {
  box-shadow: 0 0 24px var(--color-gold-glow);
  transform: scale(1.02);
}

.btn-block {
  width: 100%;
}

/* --- Footer --- */
.footer {
  margin-top: auto;
  padding-top: var(--space-2xl);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* --- Skeleton / Loading Animations (for vCard) --- */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.15; }
}

.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.06) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-sm);
  width: 80%;
}

.skeleton-text-sm {
  height: 12px;
  width: 60%;
}

.skeleton-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.skeleton-btn {
  height: 48px;
  border-radius: var(--radius-md);
  width: 100%;
}

/* --- Fade-in animation --- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fade-in-up 0.5s var(--ease-out) both;
}

/* Staggered children */
.stagger > *:nth-child(1)  { animation-delay: 0ms; }
.stagger > *:nth-child(2)  { animation-delay: 60ms; }
.stagger > *:nth-child(3)  { animation-delay: 120ms; }
.stagger > *:nth-child(4)  { animation-delay: 180ms; }
.stagger > *:nth-child(5)  { animation-delay: 240ms; }
.stagger > *:nth-child(6)  { animation-delay: 300ms; }
.stagger > *:nth-child(7)  { animation-delay: 360ms; }
.stagger > *:nth-child(8)  { animation-delay: 420ms; }
.stagger > *:nth-child(9)  { animation-delay: 480ms; }
.stagger > *:nth-child(10) { animation-delay: 540ms; }

/* --- Responsive --- */
@media (max-width: 520px) {
  .page-wrapper {
    padding: var(--space-xl) var(--space-md) var(--space-md);
  }

  .tagline {
    font-size: 0.9375rem;
  }
}

/* ============================================================
   Vendor vCard Page
   ============================================================ */

/* --- Loading state --- */
.vcard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl) 0;
}

.vcard-loading-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  margin-top: var(--space-sm);
}

.vcard-loading-lines .skeleton-text,
.vcard-loading-lines .skeleton-text-sm {
  margin-bottom: 0;
}

.vcard-loading-btns {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  margin-top: var(--space-md);
}

/* --- Avatar (initials) --- */
.vcard-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  overflow: hidden;
  padding: 16px;
}

.vcard-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Vendor card layout --- */
.vcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.vcard-name {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

/* --- Badge --- */
.vcard-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 100px;
  background: rgba(89, 172, 115, 0.12);
  color: var(--color-green);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.01em;
}

/* --- Action Buttons --- */
.vcard-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  margin-bottom: var(--space-xl);
}

.btn-whatsapp {
  background-color: #25D366;
  color: #fff;
}

.btn-whatsapp:hover {
  box-shadow: 0 0 24px rgba(37, 211, 102, 0.3);
  transform: scale(1.02);
}

.btn-whatsapp svg {
  flex-shrink: 0;
}

/* --- Transfer Data Section --- */
.vcard-transfer {
  width: 100%;
}

.vcard-transfer-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.transfer-chevron {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.transfer-active .transfer-chevron {
  transform: rotate(180deg);
}

.vcard-transfer-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  opacity: 0;
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.transfer-open {
  max-height: 500px;
  opacity: 1;
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  border: 1px solid var(--color-border);
  border-top: none;
  margin-top: -8px;
}

.vcard-transfer-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.vcard-transfer-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vcard-transfer-row:last-child {
  border-bottom: none;
}

.vcard-transfer-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  min-width: 100px;
  text-align: left;
  flex-shrink: 0;
}

.vcard-transfer-value {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  color: var(--color-text);
}

.vcard-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.75rem;
}

.vcard-copy-btn:hover {
  color: var(--color-text);
  background-color: rgba(255, 255, 255, 0.06);
}

.vcard-copy-btn.copy-feedback {
  color: var(--color-green);
  font-weight: 600;
  width: auto;
  padding: 0 8px;
}

.vcard-copy-all-btn {
  margin-top: var(--space-md);
  font-size: 0.8125rem;
}

/* --- Error state --- */
.vcard-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-3xl) 0;
}

.vcard-error-icon {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.vcard-error-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.vcard-error-text {
  font-size: 0.875rem;
  max-width: 280px;
}

/* --- Footer (vCard page) --- */
.vcard-footer-logo {
  display: inline-block;
  margin-bottom: var(--space-sm);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.vcard-footer-logo:hover {
  opacity: 0.9;
}
