/* ============================
   QR Landing Page - Light Theme
   Color Palette from Mert Portfolio
   Background: #F5F3F5 (300 11% 96%)
   Primary: #274690 (222 57% 36%)
   Smart Blue: #576CA8 (224 32% 50%)
   Text: #302B27 (27 10% 17%)
   ============================ */

:root {
  --bg: #F5F3F5;
  --bg-card: #ffffff;
  --text: #302B27;
  --text-muted: #576CA8;
  --primary: #274690;
  --primary-light: #576CA8;
  --primary-ultra-light: #e8ecf5;
  --border: #dde1ee;
  --shadow: 0 8px 32px rgba(39, 70, 144, 0.08);
  --shadow-lg: 0 20px 60px rgba(39, 70, 144, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* WhatsApp */
  --whatsapp: #25D366;
  /* WeChat */
  --wechat: #07C160;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background orbs */
.page-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #274690, #576CA8);
  top: -50px;
  right: -80px;
  animation-delay: 0s;
}

.orb-2 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #576CA8, #8e9fd4);
  bottom: 20%;
  left: -60px;
  animation-delay: -7s;
}

.orb-3 {
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, #274690, #4a6bb5);
  bottom: -30px;
  right: 30%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 10px) scale(1.02); }
}

/* Card Container */
.card-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 24px 16px;
  position: relative;
  z-index: 1;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 0 0 28px;
}

/* Profile Section */
.profile-section {
  text-align: center;
  padding: 40px 24px 24px;
  background: linear-gradient(180deg, var(--primary-ultra-light) 0%, var(--bg-card) 100%);
}

.avatar-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 8px 24px rgba(39, 70, 144, 0.2);
  transition: transform var(--transition), box-shadow var(--transition);
}

.avatar-ring:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(39, 70, 144, 0.3);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-card);
  display: block;
}

.name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 8px;
}

.location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.icon-sm {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Action Buttons */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 24px;
  margin-bottom: 24px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  padding: 14px 4px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

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

.action-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  transition: background var(--transition);
}

.action-icon svg {
  width: 20px;
  height: 20px;
}

.action-icon.whatsapp {
  background: var(--whatsapp);
}

.action-icon.wechat {
  background: var(--wechat);
}

.action-btn:hover .action-icon {
  background: var(--primary-light);
}

.action-btn:hover .action-icon.whatsapp {
  background: #1DB954;
}

.action-btn:hover .action-icon.wechat {
  background: #06a850;
}

.action-btn span {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Contact Info */
.contact-info {
  padding: 0 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.contact-row:hover {
  background: var(--primary-ultra-light);
}

.contact-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--primary);
}

.contact-row div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Social Section */
.social-section {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  margin-bottom: 24px;
}

.social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--primary);
  text-decoration: none;
  transition: all var(--transition);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

.social-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 70, 144, 0.25);
}

/* Save Contact Button */
.save-contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 48px);
  margin: 0 auto;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(39, 70, 144, 0.25);
}

.save-contact-btn svg {
  width: 20px;
  height: 20px;
}

.save-contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(39, 70, 144, 0.35);
}

.save-contact-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(39, 70, 144, 0.2);
}

/* WeChat Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  max-width: 320px;
  width: calc(100% - 48px);
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text);
}

.modal-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.wechat-id {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary-ultra-light);
  border-radius: 10px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
  -webkit-user-select: all;
  user-select: all;
  cursor: text;
}

.wechat-qr {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin: 8px auto;
  display: block;
}

/* ========================
   Responsive - Mobile First
   ======================== */

/* Very small screens */
@media (max-width: 360px) {
  .card-container {
    padding: 12px 8px;
  }

  .card {
    border-radius: 20px;
  }

  .profile-section {
    padding: 28px 16px 20px;
  }

  .avatar-ring {
    width: 100px;
    height: 100px;
  }

  .name {
    font-size: 1.5rem;
  }

  .action-buttons {
    gap: 8px;
    padding: 0 16px;
  }

  .action-icon {
    width: 36px;
    height: 36px;
  }

  .action-icon svg {
    width: 18px;
    height: 18px;
  }

  .action-btn span {
    font-size: 0.68rem;
  }

  .contact-info {
    padding: 0 16px;
  }

  .contact-row {
    padding: 12px 12px;
    gap: 10px;
  }

  .contact-value {
    font-size: 0.82rem;
  }

  .social-section {
    padding: 0 16px;
    gap: 8px;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }

  .save-contact-btn {
    width: calc(100% - 32px);
    font-size: 0.9rem;
    padding: 12px 20px;
  }
}

/* Tablets and up */
@media (min-width: 768px) {
  .card-container {
    align-items: center;
    padding: 40px 24px;
  }

  .card {
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(39, 70, 144, 0.05);
  }

  .profile-section {
    padding: 48px 32px 28px;
  }

  .avatar-ring {
    width: 130px;
    height: 130px;
  }

  .name {
    font-size: 1.9rem;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .bg-orb {
    opacity: 0.3;
  }

  .orb-1 {
    width: 400px;
    height: 400px;
  }

  .orb-2 {
    width: 280px;
    height: 280px;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .action-btn:hover {
    transform: none;
    box-shadow: none;
  }

  .action-btn:active {
    transform: scale(0.96);
    background: var(--primary-ultra-light);
  }

  .social-link:hover {
    transform: none;
    box-shadow: none;
    background: var(--bg);
    color: var(--primary);
    border-color: var(--border);
  }

  .social-link:active {
    transform: scale(0.92);
    background: var(--primary);
    color: #fff;
  }

  .save-contact-btn:hover {
    transform: none;
  }

  .save-contact-btn:active {
    transform: scale(0.98);
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg-orb {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  .card-container {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}
