/* ==========================================================================
   ZCARDIN — Premium NFC Digital Identity
   clear.css  |  UI redesign only. No HTML/PHP structure changes required.
   Works with the existing markup in profile_view.php:
   .container > .main > .top > .pic > .InPic > img.Profilepic
   .Uppermiddle > .name (h4, .info>p)
   .Lowermiddle > a.SaveBTN
   .bottom > a > .IconBTN > img
   ========================================================================== */

/* ---- Fonts ------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ---- Design tokens ----------------------------------------------------- */
:root {
  --bg: #050505;
  --card: rgba(255, 255, 255, 0.05);
  --card-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --accent: #00e5ff;
  --purple: #8b5cf6;
  --gold: #d4af37;
  --text: #ffffff;
  --muted: #9ca3af;
  --radius: 28px;
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: 'Manrope', 'Montserrat', sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Futuristic animated background ------------------------------------ */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

body::before {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle at center, var(--accent), transparent 70%);
  animation: floatGlow 14s ease-in-out infinite;
}

body::after {
  width: 560px;
  height: 560px;
  bottom: -200px;
  right: -140px;
  background: radial-gradient(circle at center, var(--purple), transparent 70%);
  animation: floatGlow 18s ease-in-out infinite reverse;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.12); }
}

/* Fine grid + noise overlay for depth */
.container::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
}

/* ---- Layout: turn the absolute template into a clean glass card -------- */
.container {
  height: auto;
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: transparent;
  position: relative;
  z-index: 1;
}

.main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 28px 34px;

  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  background-image: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
  animation: cardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Prismatic sheen across the top edge of the card */
.main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple), var(--gold));
  opacity: 0.85;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Neutralize the old absolute positioning --------------------------- */
.top,
.Uppermiddle,
.Lowermiddle,
.bottom,
.website {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.top { margin-bottom: 6px; }
.Uppermiddle { margin-bottom: 18px; }
.Lowermiddle { margin-bottom: 22px; }

/* ---- Profile image: floating, glowing, luxury ring -------------------- */
.pic {
  width: 168px;
  height: 168px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: none;
  background: conic-gradient(from 180deg, var(--accent), var(--purple), var(--gold), var(--accent));
  padding: 3px;
  animation: floatPic 6s ease-in-out infinite;
}

.pic::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.35), transparent 70%);
  filter: blur(14px);
  z-index: -1;
  animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes floatPic {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.08); }
}

.InPic {
  margin: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: none;
  background: var(--bg);
  padding: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.InPic > div {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
}

.Profilepic {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background-position: center;
}

/* ---- Name / title / company typography -------------------------------- */
.name {
  position: relative;
  top: auto;
  width: 100%;
  height: auto;
  color: var(--text);
  font-size: inherit;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.name h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* The job title sits after the <br> inside h4 — soften it visually */
.name h4 br + * { color: var(--muted); }

.info {
  margin-top: 6px;
}

.info p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---- Primary CTA: Save contact ---------------------------------------- */
.SaveBTN {
  width: 100%;
  max-width: 320px;
  height: 58px;
  text-decoration: none;
  text-transform: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 16px;
  color: #050505;
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 10px 30px rgba(0, 229, 255, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.SaveBTN::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.SaveBTN span,
.SaveBTN {
  position: relative;
}

.SaveBTN:hover {
  transform: translateY(-3px);
  box-shadow:
    0 18px 44px rgba(0, 229, 255, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* ---- Action buttons: floating circular glass -------------------------- */
.bottom {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}

.bottom a {
  display: flex;
}

.IconBTN {
  width: 60px;
  height: 60px;
  margin: 0;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.IconBTN:hover {
  transform: translateY(-5px);
  background: var(--card-strong);
  border-color: var(--border-hover);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 229, 255, 0.3);
}

/* Icon glyphs — normalize + brighten to white on dark */
.callIcon,
.WhatsIcon,
.EmailIcon,
.linkedin {
  width: 26px;
  height: 26px;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

/* Keep Instagram's colored PNG intact (no invert) */
img[src*="instagram"] {
  filter: none !important;
  opacity: 1;
  width: 28px;
  height: 28px;
}

/* ---- Footer / website slot (kept empty, no "Powered by" label) -------- */
.website {
  display: none;
}

.weblogo {
  color: var(--muted);
  font-size: 12px;
}

/* ---- Instagram gradient helper (kept from original) -------------------- */
.btn.instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
}

/* ---- Entrance stagger --------------------------------------------------- */
.top { animation: rise 0.7s ease both 0.1s; }
.Uppermiddle { animation: rise 0.7s ease both 0.2s; }
.Lowermiddle { animation: rise 0.7s ease both 0.3s; }
.bottom { animation: rise 0.7s ease both 0.4s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive -------------------------------------------------------- */
/* On phones the card becomes a full-screen, edge-to-edge experience */
@media (max-width: 640px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .container {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .main {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: center;
    gap: 14px;
    padding: 48px 24px calc(40px + env(safe-area-inset-bottom));
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 420px) {
  .pic { width: 148px; height: 148px; }
  .name h4 { font-size: 21px; }
  .IconBTN { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
