/* 
  ==========================================
  Digital Business Card - Core Styles (Refactored)
  ==========================================
*/
:root {
  --brand-color: #0070D7;
  --bg-color: #f0f2f5;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --card-bg: #ffffff;
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --border-radius-full: 9999px;
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 15px 35px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding: 20px 10px;
}

/* Base Card Container */
.card-root:not(.demo-mode) {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  background: var(--card-bg);
  animation: fadeUp 0.6s ease-out forwards;
}

/* DEMO MODE: Side-by-side view */
.card-root.demo-mode {
  width: 100%;
  max-width: 1600px;
  animation: fadeUp 0.6s ease-out forwards;
}
.demo-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  align-items: stretch;
}
.demo-card-wrapper {
  width: 100%;
  max-width: 400px;
  background: transparent;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.demo-label {
  background: #222;
  color: #fff;
  text-align: center;
  padding: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--border-radius-full);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 14px;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Common Text Elements */
h1, h2, h3 { font-family: 'Outfit', sans-serif; }

/* Remove empty links */
a[href=""], a[href="null"], a[href="undefined"] { display: none !important; }


/* 
  ==========================================
  TEMPLATE 1: VISUAL 
  Matches "Visual Background Card" screenshot
  ==========================================
*/
.visual-template {
  background: #f8f9fa;
  min-height: 100%;
  padding-bottom: 30px;
}
.visual-template .header-bg {
  width: 100%;
  height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.visual-template .profile-section {
  text-align: center;
  padding: 0 24px 20px;
  position: relative;
  margin-top: -65px;
}
.visual-template .profile-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 4px solid #fff;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-bottom: 12px;
  background: #fff;
  position: relative;
  z-index: 2;
}
.visual-template .name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.visual-template .company {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.visual-template .title {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.visual-template .tagline {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.visual-template .buttons-container {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.visual-template .btn-block-light {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  background: #fff;
  border-radius: 12px;
  border-left: 6px solid #111827; /* Dark edge accent */
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.visual-template .btn-block-light:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-left-color: var(--brand-color);
}
.visual-template .btn-block-light i {
  color: #475569;
  font-size: 18px;
  margin-right: 16px;
  width: 24px;
  text-align: center;
}

.visual-template .action-buttons-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
}
.visual-template .btn-circle.outline {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: transparent;
  color: #475569;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}
.visual-template .btn-pill.solid {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--border-radius-full);
  background: var(--brand-color);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}
.visual-template .btn-circle.outline:hover { background: #e2e8f0; }
.visual-template .btn-pill.solid:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.visual-template .qr-section {
  text-align: center;
  padding: 24px;
}
.visual-template .qr-image {
  width: 120px;
  height: 120px;
  border-radius: var(--border-radius-sm);
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}


/* 
  ==========================================
  TEMPLATE 2: CORPORATE 
  Matches "Corporate Card" screenshot (Dark Blue)
  ==========================================
*/
.corporate-template {
  background: #122436; /* Deep blue from screenshot */
  color: #ffffff; 
  font-family: 'Inter', sans-serif;
  min-height: 100%;
}
.corporate-template .name {
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.corporate-template .title {
  color: #ffffff;
  opacity: 0.9;
  font-size: 14px;
  font-weight: 500;
}
.corporate-template .tagline {
  color: #ffffff;
  opacity: 0.8;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 6px;
  margin-bottom: 24px;
}
.corporate-template .top-section {
  padding: 50px 24px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.corporate-template .logo-img {
  max-width: 180px;
  max-height: 50px;
  margin-bottom: 40px;
  object-fit: contain;
}
.corporate-template .profile-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  border: 2px solid #ffffff;
}

/* Square Rounded Outline Buttons */
.corporate-template .buttons-grid-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 24px 40px;
}
.corporate-template .btn-rounded-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  transition: var(--transition);
  cursor: pointer;
}
.corporate-template .btn-rounded-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Wide White Save Contact Button */
.corporate-template .action-buttons-single {
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.corporate-template .btn-save-contact {
  width: 100%;
  background: #ffffff;
  color: #122436;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.corporate-template .btn-save-contact:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}
.corporate-template .btn-copy-link {
  width: 100%;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 16px;
  padding: 14px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.corporate-template .btn-copy-link:hover {
  background: rgba(255,255,255,0.1);
}

.corporate-template .qr-section-dark {
  text-align: center;
  padding: 30px 24px;
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.corporate-template .qr-image {
  width: 140px;
  height: 140px;
  border-radius: var(--border-radius-sm);
  padding: 8px;
  background: #fff;
  margin-bottom: 12px;
}
.corporate-template .qr-section-dark p {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}


/* 
  ==========================================
  TEMPLATE 3: SOCIAL HUB 
  Matches "Linktree" style screenshot
  ==========================================
*/
.social-template {
  background: #ffffff;
  min-height: 100%;
  padding-bottom: 40px;
}
.social-template .profile-header {
  background: linear-gradient(135deg, var(--brand-color) 0%, #10b981 100%);
  padding: 40px 24px 80px;
  text-align: center;
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  margin-bottom: -50px;
}
.social-template .profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  margin-bottom: 16px;
}
.social-template .name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.social-template .verified-badge {
  color: #fff;
  font-size: 16px;
}
.social-template .title {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 10px;
}
.social-template .tagline {
  font-size: 13px;
  opacity: 0.8;
  line-height: 1.5;
  max-width: 90%;
  margin: 0 auto;
}

.social-template .mini-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 24px 20px;
  position: relative;
  z-index: 10;
}
.social-template .btn-circle.sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--brand-color);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}
.social-template .btn-circle.sm:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-color);
}

.social-template .main-buttons {
  display: flex;
  gap: 12px;
  padding: 0 24px 30px;
}
.social-template .btn-pill.half {
  flex: 1;
  padding: 12px;
  border-radius: var(--border-radius-full);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.social-template .btn-pill.solid {
  background: var(--brand-color);
  color: #fff;
  border: none;
}
.social-template .btn-pill.outline {
  background: #fff;
  color: var(--brand-color);
  border: 1px solid var(--brand-color);
}
.social-template .btn-pill.solid:hover { background: #005bb5; }
.social-template .btn-pill.outline:hover { background: #f0f7ff; }

/* Horizontal Social Raw */
.social-template .social-icons-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 24px 30px;
}
.social-template .social-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  transition: var(--transition);
}
.social-template .social-circle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-md);
}

/* Vertical Links */
.social-template .vertical-links {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.social-template .link-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 18px 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.social-template .link-block:hover {
  border-color: var(--brand-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.social-template .link-block i {
  color: var(--text-secondary);
  font-size: 18px;
}

.social-template .qr-footer {
  text-align: center;
  padding: 40px 24px 0;
}
.social-template .qr-image {
  width: 100px;
  height: 100px;
  border-radius: var(--border-radius-sm);
  padding: 6px;
  background: #fff;
  border: 1px solid #eee;
}
