/* ==========================================================================
   Roua Alzubair Digital Business Card & PWA
   Aesthetic: Luxury Executive Card (Cream, Gold, Sleek Modern Typography)
   ========================================================================== */

:root {
  --color-bg-base: #FAF7F2;
  --color-bg-card: #FFFFFF;
  --color-gold-primary: #A88856;
  --color-gold-dark: #8C6D3B;
  --color-gold-light: #F7EEE2;
  --color-gold-border: rgba(197, 168, 128, 0.45);
  --color-text-main: #141414;
  --color-text-muted: #7E7260;
  --color-border-subtle: rgba(225, 218, 205, 0.6);
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  background-color: var(--color-bg-base);
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Background Soft Waves */
.bg-waves {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('assets/bg.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 24px);
}

/* Header Section */
.header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 6px;
  margin-bottom: 8px;
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2px;
}

.brand-logo {
  width: 130px;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: contrast(1.05);
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.person-name {
  font-size: clamp(21px, 6vw, 25px);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--color-text-main);
  margin-top: 4px;
  margin-bottom: 4px;
  line-height: 1.15;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.person-title {
  font-size: clamp(11.5px, 3.4vw, 13px);
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--color-gold-primary);
  text-transform: uppercase;
  line-height: 1.2;
}

.gold-accent-line {
  width: 48px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #C4A77D 25%, #C4A77D 75%, transparent);
  margin: 9px auto 6px;
}

/* QR Code Section & Card */
.qr-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.qr-card {
  width: 100%;
  max-width: 360px;
  background: var(--color-bg-card);
  border-radius: 24px;
  border: 1px solid var(--color-gold-border);
  box-shadow: 0 10px 30px rgba(175, 145, 95, 0.12), 0 2px 8px rgba(0, 0, 0, 0.03);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  position: relative;
}

.qr-card:active {
  transform: scale(0.985);
  box-shadow: 0 6px 18px rgba(175, 145, 95, 0.10);
}

.qr-card-inner {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #FFFFFF;
}

.qr-code-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-code-wrapper svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  display: block;
  shape-rendering: crispEdges;
}

.qr-loading-placeholder {
  width: 100%;
  height: 100%;
  background: #f7f7f7;
  border-radius: 12px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 0.9; }
  100% { opacity: 0.6; }
}

/* Pill Under QR: Scan to save my contact */
.scan-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FAF4EB;
  border: 1px solid #EADBCA;
  border-radius: 999px;
  padding: 6px 16px;
  margin-top: 14px;
  margin-bottom: 4px;
  color: var(--color-gold-dark);
}

.pill-icon {
  display: flex;
  align-items: center;
  color: var(--color-gold-dark);
}

.pill-divider {
  width: 1px;
  height: 12px;
  background-color: #DBC8B0;
}

.pill-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.qr-tap-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  color: #A39684;
  margin-top: 4px;
}

/* Contact Details Section */
.contact-details-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.contact-list {
  width: 100%;
  max-width: 360px;
  list-style: none;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  border: 1px solid rgba(220, 210, 192, 0.6);
  box-shadow: 0 4px 18px rgba(180, 150, 100, 0.06);
  padding: 4px 14px;
  overflow: hidden;
}

.contact-item {
  width: 100%;
  border-bottom: 1px solid var(--color-border-subtle);
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 2px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
  border-radius: 12px;
}

.contact-link:active {
  background-color: rgba(247, 238, 226, 0.5);
}

.icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-gold-light);
  color: var(--color-gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.contact-link:active .icon-circle {
  transform: scale(0.94);
}

.contact-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.contact-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.contact-value {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.25;
  white-space: pre-line;
}

.scroll-bottom-padding {
  height: 30px;
  flex-shrink: 0;
}

/* ==========================================================================
   Fullscreen QR Code Modal (Pure White, Full Immersion, Tap to Exit)
   ========================================================================== */

.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 16px) 20px calc(var(--safe-bottom) + 20px);
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  cursor: pointer;
}

.fullscreen-overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fullscreen-header {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.fullscreen-title-box {
  display: flex;
  flex-direction: column;
}

.fs-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #111111;
}

.fs-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--color-gold-primary);
  text-transform: uppercase;
}

.fullscreen-close-btn {
  background: #F4F1EA;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444444;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.fullscreen-close-btn:active {
  background: #E8E2D5;
  transform: scale(0.92);
}

.fullscreen-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.fullscreen-qr-container {
  width: min(88vw, 75vh);
  height: min(88vw, 75vh);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  padding: 10px;
}

.fullscreen-qr-container svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  display: block;
  shape-rendering: crispEdges;
}

.fullscreen-footer-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 14px;
  gap: 6px;
}

.fs-action-pill {
  background: #FAF4EB;
  border: 1px solid #E5D5C0;
  color: var(--color-gold-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 999px;
}

.fs-subtext {
  font-size: 11.5px;
  color: #888888;
  font-weight: 500;
}

/* ==========================================================================
   PWA Install Hint Banner (Dismissible)
   ========================================================================== */

.pwa-install-banner {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 12px);
  left: 14px;
  right: 14px;
  max-width: 412px;
  margin: 0 auto;
  z-index: 999;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(197, 168, 128, 0.5);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pwa-install-banner[hidden] {
  display: none;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 12px;
}

.pwa-banner-icon {
  flex-shrink: 0;
}

.pwa-banner-icon img {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.pwa-banner-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.2;
}

.pwa-banner-text span {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.25;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-install {
  background: var(--color-gold-primary);
  color: #FFFFFF;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-install:active {
  background: var(--color-gold-dark);
}

.btn-dismiss {
  background: transparent;
  border: none;
  color: #999999;
  font-size: 16px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Small Screen Adjustments
   ========================================================================== */

@media (max-height: 680px) {
  .brand-logo {
    width: 100px;
    max-height: 70px;
  }
  .person-name {
    font-size: 20px;
  }
  .person-title {
    font-size: 11px;
  }
  .qr-card {
    padding: 12px 12px 10px;
  }
  .scan-pill {
    margin-top: 8px;
    padding: 4px 12px;
  }
  .contact-link {
    padding: 8px 2px;
  }
}
