/* ==========================================================================
   SUSHEN JAYASURIYA — DIGITAL BUSINESS CARD STYLESHEET
   3D Flipping Card, Luxury Obsidian / Gold / Cyan Aesthetic, Print-Ready Layout
   ========================================================================== */

:root {
  --bg-primary: #060911;
  --bg-card: #0b1120;
  --card-front-bg: linear-gradient(135deg, #0d1527 0%, #060911 60%, #08101e 100%);
  --card-back-bg: linear-gradient(135deg, #08101e 0%, #060911 50%, #0d1527 100%);
  --accent-cyan: #00f0ff;
  --accent-emerald: #00ff88;
  --accent-gold: #e5b95c;
  --text-white: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-cyan: rgba(0, 240, 255, 0.25);
  --border-gold: rgba(229, 185, 92, 0.4);
  --card-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 240, 255, 0.15);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   CYBERNETIC THEME CURSOR RETICLE
   ========================================================================== */
@media (pointer: fine) {
  body, a, button, input, select, textarea, [role="button"], .business-card-stage, .quick-icon-btn, .btn-primary-vcard, .btn-secondary-action {
    cursor: none !important;
  }
}

.cyber-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background-color: #00f0ff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px #00f0ff;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.08s ease;
}

.cyber-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(0, 240, 255, 0.65);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999998;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease, width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.cyber-cursor-ring.active,
.cyber-cursor-dot.active {
  opacity: 1;
}

.cyber-cursor-ring.hover {
  width: 48px;
  height: 48px;
  border-color: #00ff88;
  background-color: rgba(0, 255, 136, 0.08);
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.4);
}

.cyber-cursor-dot.hover {
  background-color: #00ff88;
  box-shadow: 0 0 12px #00ff88;
  transform: translate(-50%, -50%) scale(1.3);
}

.cyber-cursor-ring.click {
  transform: translate(-50%, -50%) scale(0.75);
  border-color: #00f0ff;
  background-color: rgba(0, 240, 255, 0.2);
}

@media (pointer: coarse), (hover: none) {
  .cyber-cursor-dot,
  .cyber-cursor-ring,
  .cyber-click-ripple,
  .cyber-click-star {
    display: none !important;
  }
}

/* Cyber Starburst Click FX */
.cyber-click-ripple {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 240, 255, 0.9);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.7), inset 0 0 10px rgba(0, 255, 136, 0.5);
  pointer-events: none;
  z-index: 999990;
  transform: translate(-50%, -50%) scale(0.2);
  animation: cyberRipplePulse 0.55s cubic-bezier(0.1, 0.85, 0.25, 1) forwards;
}

@keyframes cyberRipplePulse {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(3.8); opacity: 0; border-color: rgba(0, 255, 136, 0.3); }
}

.cyber-click-star {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999991;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  animation: cyberStarFade 0.6s cubic-bezier(0.12, 0.88, 0.3, 1) forwards;
}

.cyber-click-star svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px currentColor);
}

@keyframes cyberStarFade {
  0% { transform: translate(-50%, -50%) translate3d(0, 0, 0) scale(0.2) rotate(0deg); opacity: 1; }
  70% { opacity: 0.9; }
  100% { transform: translate(-50%, -50%) translate3d(var(--tx), var(--ty), 0) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* Background Atmosphere */
.card-ambient-backdrop {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(0, 240, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(6, 9, 17, 0.95) 0%, #060911 100%);
  z-index: -2;
  pointer-events: none;
}

.card-grid-lines {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: -1;
  pointer-events: none;
}

/* Header Navigation Bar */
.card-nav-header {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.btn-back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.btn-back-home:hover {
  color: var(--text-white);
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  transform: translateX(-2px);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--border-cyan);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.live-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Main Container */
.card-wrapper-container {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1200px;
}

/* 3D Flippable Business Card Stage */
.business-card-stage {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1.75 / 1;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.business-card-stage.is-flipped {
  transform: rotateY(180deg);
}

/* Common Card Faces */
.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem;
  overflow: hidden;
  border: 1px solid var(--border-gold);
}

/* Front Face */
.card-face-front {
  background: var(--card-front-bg);
  transform: rotateY(0deg);
}

.card-face-front::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

/* Card Chamfer & Neon Glow Lines */
.card-chamfer-edge {
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(to bottom, transparent, var(--accent-cyan), transparent);
}
.card-chamfer-edge.edge-left { left: 8px; }
.card-chamfer-edge.edge-right { right: 8px; }

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.card-logo-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-logo-emblem {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.card-logo-emblem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.card-nfc-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(229, 185, 92, 0.1);
  border: 1px solid rgba(229, 185, 92, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.card-center-body {
  position: relative;
  z-index: 2;
  margin: auto 0;
}

.card-name-title {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.card-role-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-top: 0.35rem;
  letter-spacing: 0.01em;
}

.card-sub-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
}

.card-badges-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.card-mini-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.flip-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s ease;
}

.business-card-stage:hover .flip-hint {
  color: var(--accent-cyan);
}

/* Back Face */
.card-face-back {
  background: var(--card-back-bg);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
}

.card-back-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 0.6rem;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.3);
  border: 2px solid var(--accent-cyan);
}

.card-back-qr-col img, .card-back-qr-col svg {
  width: 105px;
  height: 105px;
  display: block;
}

.card-back-qr-label {
  font-size: 0.625rem;
  font-family: var(--font-mono);
  color: #060911;
  font-weight: 700;
  margin-top: 0.3rem;
  text-transform: uppercase;
}

.card-back-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.card-contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.775rem;
  color: #e2e8f0;
  text-decoration: none;
  transition: all 0.2s ease;
}

.card-contact-item:hover {
  color: var(--accent-cyan);
  transform: translateX(2px);
}

.card-contact-item i {
  color: var(--accent-cyan);
  width: 16px;
  font-size: 0.85rem;
  text-align: center;
}

.card-back-footer {
  margin-top: 0.25rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.65rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Interactive Control Action Buttons */
.card-actions-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.btn-primary-vcard {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #00f0ff 0%, #00b4d8 100%);
  color: #060911;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.95rem 1.5rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.35);
  transition: all 0.25s ease;
}

.btn-primary-vcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 240, 255, 0.5);
  background: linear-gradient(135deg, #00ff88 0%, #00f0ff 100%);
}

.btn-primary-vcard:active {
  transform: translateY(0);
}

.action-secondary-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.btn-secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

/* Quick Links Grid */
.card-quick-links-section {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.25rem;
}

.quick-links-title {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.quick-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  padding: 0.6rem 0.4rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.quick-icon-btn:hover {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  transform: translateY(-2px);
}

.quick-icon-btn i {
  font-size: 1.15rem;
}

/* Toast Notice */
.card-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #00f0ff;
  color: #060911;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

.card-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   PRINT-READY SPECIFICATIONS (3.5" x 2.0" Business Card Standard 300 DPI)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }

  .card-ambient-backdrop,
  .card-grid-lines,
  .card-nav-header,
  .card-actions-grid,
  .card-quick-links-section,
  .flip-hint,
  .card-toast {
    display: none !important;
  }

  .card-wrapper-container {
    max-width: 100% !important;
    perspective: none !important;
  }

  .print-sheet-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.5cm !important;
    page-break-inside: avoid;
  }

  /* Physical Card Dimensions: 3.5in x 2.0in (88.9mm x 50.8mm) */
  .business-card-stage {
    display: none !important;
  }

  .print-card-box {
    display: block !important;
    width: 3.5in !important;
    height: 2in !important;
    border: 1px dashed #999999 !important;
    border-radius: 4mm !important;
    overflow: hidden !important;
    box-shadow: none !important;
    position: relative !important;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-card-front {
    background: #08101e !important;
    color: #ffffff !important;
    padding: 0.3in !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .print-card-back {
    background: #08101e !important;
    color: #ffffff !important;
    padding: 0.25in !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.25in !important;
  }

  .print-label-guide {
    display: block !important;
    font-size: 9pt;
    color: #555555;
    margin-bottom: 4px;
    font-family: sans-serif;
  }
}

.print-sheet-wrapper {
  display: none;
}

@media (max-width: 520px) {
  .business-card-stage {
    aspect-ratio: 1.6 / 1;
  }
  .card-face {
    padding: 1.25rem;
  }
  .card-name-title {
    font-size: 1.35rem;
  }
  .card-face-back {
    gap: 0.75rem;
    padding: 1rem;
  }
  .card-back-qr-col img, .card-back-qr-col svg {
    width: 85px;
    height: 85px;
  }
  .action-secondary-row {
    grid-template-columns: 1fr;
  }
}
