/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  /* Prevent font-size inflation on iOS rotate */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  /* Use dvh so the card sits above the mobile browser chrome */
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  /* Prevent iOS elastic scroll bounce */
  overscroll-behavior: none;
  font-family: 'Inter', system-ui, sans-serif;
  background: #111;
  /* Support notched phones */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ============================================================
   BACKGROUND — full-screen blurred photo
   ============================================================ */
.bg-layer {
  position: fixed;
  inset: 0;
  background-image: url('media/background.jpg');
  background-size: auto 100%;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #111;
  filter: blur(8px) brightness(0.55) saturate(0.8);
  z-index: 0;
}

/* On portrait mobile the photo is same orientation — use cover so it fills */
@media (max-width: 500px) and (orientation: portrait) {
  .bg-layer {
    background-size: cover;
    background-position: center top;
  }
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

/* ============================================================
   CARD WRAPPER — centers the card
   ============================================================ */
.card-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  /* Extra top padding for avatar overflow + safe area */
  padding: calc(64px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  width: 100%;
  max-width: 380px;
  /* Fluid horizontal padding */
  padding: 60px clamp(20px, 8vw, 32px) 32px;

  background: rgba(30, 28, 36, 0.75);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255,255,255,0.07);

  /* subtle entrance animation */
  animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ============================================================
   AVATAR
   ============================================================ */
.avatar-ring {
  margin-top: -100px; /* pull avatar above card top edge */
  width: 90px;
  height: 90px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #a855f7, #ec4899, #f97316);
  box-shadow: 0 0 0 3px rgba(30, 28, 36, 0.85);
  flex-shrink: 0;
}

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

/* ============================================================
   NAME
   ============================================================ */
.profile-name {
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin-top: 4px;
}

/* ============================================================
   AVAILABLE BADGE
   ============================================================ */
.badge-available {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 18px;
  background: #22c55e;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 0.9; }
  50%       { transform: scale(1.3); opacity: 0.6; }
}

/* ============================================================
   META ROWS (clock / location)
   ============================================================ */
.meta-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.meta-icon {
  color: rgba(255, 255, 255, 0.50);
  display: flex;
  align-items: center;
}

.meta-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 400;
}

/* ============================================================
   BIO
   ============================================================ */
.bio-text {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  line-height: 1.6;
  max-width: 290px;
  margin: 4px 0 2px;
}

/* ============================================================
   CTA BUTTON
   ============================================================ */
.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  /* Min 56px height — Apple/Google tap target guideline */
  min-height: 56px;
  padding: 16px 24px;
  margin-top: 8px;

  background: linear-gradient(90deg, #b83fef 0%, #e040fb 50%, #c840fa 100%);
  background-size: 200% 100%;
  border-radius: 999px;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  /* Prevent callout on long-press iOS */
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 24px rgba(192, 64, 250, 0.50);

  transition:
    background-position 0.4s ease,
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

.cta-btn:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(192, 64, 250, 0.70);
}

.cta-btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 14px rgba(192, 64, 250, 0.45);
}

.tg-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* ============================================================
   RESPONSIVE — small & very small screens
   ============================================================ */

/* Phones ≤ 420px */
@media (max-width: 420px) {
  .card {
    border-radius: 18px;
  }
  .profile-name {
    font-size: 1.35rem;
  }
  .bio-text {
    font-size: 0.84rem;
  }
}

/* Very narrow phones (e.g. iPhone SE 320px) */
@media (max-width: 360px) {
  .avatar-ring {
    width: 78px;
    height: 78px;
  }
  .profile-name {
    font-size: 1.2rem;
  }
  .badge-available {
    font-size: 0.78rem;
    padding: 5px 14px;
  }
}

/* Landscape mobile — keep card compact so nothing is cut off */
@media (max-height: 500px) and (orientation: landscape) {
  .card-wrapper {
    padding-top: 80px;
    align-items: flex-start;
  }
  .avatar-ring {
    width: 70px;
    height: 70px;
    margin-top: -80px;
  }
  .card {
    padding-top: 48px;
    gap: 8px;
  }
  .bio-text {
    display: none;
  }
}
