/* ==========================================================================
   Premium Digital Business Card Style Sheet
   Reference: Apple UI, Stripe, Linear, Notion, Dribbble quality
   ========================================================================== */

/* Google Font: Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  /* Colors */
  --bg-primary: #F7F8FC;
  --card-bg: #FFFFFF;
  --card-border: rgba(0, 0, 0, 0.05);
  --text-primary: #0F0F14;
  --text-secondary: #6B7280;
  --primary-color: #6D3EF5;
  --secondary-color: #00AEEF;
  --accent-gradient: linear-gradient(135deg, #6D3EF5 0%, #00AEEF 100%);
  --accent-gradient-hover: linear-gradient(135deg, #592ee6 0%, #009ecc 100%);
  
  /* Shadows & Layout */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 40px rgba(109, 62, 245, 0.08);
  --shadow-premium: 0 30px 60px -15px rgba(10, 11, 16, 0.08), 0 12px 24px -12px rgba(10, 11, 16, 0.03);
  --card-blur: 24px;
  
  /* Custom Background Image */
  --card-bg-image: url('background.jpg');
}

[data-theme="dark"] {
  /* Colors */
  --bg-primary: #08090C;
  --card-bg: rgba(22, 24, 33, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --primary-color: #A384FF;
  --secondary-color: #26C6FF;
  --accent-gradient: linear-gradient(135deg, #8154FF 0%, #00C2FF 100%);
  --accent-gradient-hover: linear-gradient(135deg, #703eff 0%, #00b0e6 100%);
  
  /* Shadows & Layout */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(129, 84, 255, 0.15);
  --shadow-premium: 0 40px 80px -20px rgba(0, 0, 0, 0.6), 0 16px 32px -16px rgba(0, 0, 0, 0.4);
  
  /* Custom Background Image Overlay */
  --card-bg-image: linear-gradient(rgba(10, 11, 16, 0.88), rgba(10, 11, 16, 0.88)), url('background.jpg');
}

/* Base resets & styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 40px 20px;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.5s ease;
}

/* Smooth Fade-in Page Animation */
.fade-in-page {
  animation: pageFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Floating background blur blobs */
.bg-blur-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  mix-blend-mode: multiply;
  transition: opacity 0.5s ease;
}

[data-theme="dark"] .blob {
  opacity: 0.25;
  mix-blend-mode: screen;
}

.blob-1 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(109, 62, 245, 0.25) 0%, rgba(109, 62, 245, 0) 70%);
  top: -50px;
  left: -50px;
  animation: floatSlow1 12s infinite alternate ease-in-out;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 174, 239, 0.2) 0%, rgba(0, 174, 239, 0) 70%);
  bottom: -100px;
  right: -50px;
  animation: floatSlow2 15s infinite alternate ease-in-out;
}

@keyframes floatSlow1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 40px) scale(1.1); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes floatSlow2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, -30px) scale(0.9); }
  100% { transform: translate(30px, 20px) scale(1.05); }
}

/* Main Mobile Viewport Card Container */
.card-container {
  width: 100%;
  max-width: 440px;
  height: 880px;
  background: var(--card-bg-image);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--card-border);
  border-radius: 30px;
  box-shadow: var(--shadow-premium);
  padding: 24px 24px;
  z-index: 2;
  position: relative;
  transition: background 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease, box-shadow 0.5s ease;
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent content overflowing the card border radius */
}

/* Theme Toggle Button */
.theme-toggle-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(109, 62, 245, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle-btn:hover {
  transform: scale(1.08) rotate(15deg);
  background: rgba(109, 62, 245, 0.1);
  color: var(--primary-color);
}

[data-theme="dark"] .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
}

/* Logo Section */
.logo-container {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 12px;
}

.logo-text {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--text-primary);
  opacity: 0.9;
  text-transform: uppercase;
}

/* Profile Photo Section */
.profile-section {
  text-align: center;
  margin-bottom: 12px;
}

.profile-img-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-img-glow {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: var(--accent-gradient);
  border-radius: 50%;
  z-index: 1;
  animation: rotateGlow 6s linear infinite;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 4px;
}

@keyframes rotateGlow {
  100% {
    transform: rotate(360deg);
  }
}

.profile-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
  border: 4px solid var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease;
}

.profile-img-container:hover .profile-img {
  transform: scale(1.08);
}

.profile-name {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.profile-designation {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.company-badge {
  background: rgba(109, 62, 245, 0.08);
  color: var(--primary-color);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(109, 62, 245, 0.1);
  transition: all 0.3s ease;
}

[data-theme="dark"] .company-badge {
  background: rgba(129, 84, 255, 0.15);
  border-color: rgba(129, 84, 255, 0.2);
}

.contact-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.contact-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 10px 8px;
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.contact-action-btn i {
  font-size: 1.35rem;
  margin-bottom: 6px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-action-btn span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0.9;
}

.contact-action-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(109, 62, 245, 0.2);
}

.contact-action-btn:hover i {
  transform: scale(1.18);
}

/* Primary Button (Save Contact) */
.primary-btn-wrapper {
  margin-bottom: 14px;
}

.btn-primary-gradient {
  background: var(--accent-gradient);
  border: none;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.95rem;
  width: 100%;
  padding: 12px 24px;
  border-radius: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 24px -6px rgba(109, 62, 245, 0.35);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(109, 62, 245, 0.45);
  background: var(--accent-gradient-hover);
}

.btn-primary-gradient:active {
  transform: translateY(1px);
}

/* Connect & Explore Link Cards */
.explore-section {
  margin-bottom: 8px;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.explore-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(109, 62, 245, 0.2) transparent;
}

/* Custom scrollbar for explore cards container */
.explore-container::-webkit-scrollbar {
  width: 4px;
}

.explore-container::-webkit-scrollbar-track {
  background: transparent;
}

.explore-container::-webkit-scrollbar-thumb {
  background-color: rgba(109, 62, 245, 0.15);
  border-radius: 20px;
}

.explore-card {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 10px 16px;
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.explore-card-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(109, 62, 245, 0.05);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: all 0.4s ease;
}

[data-theme="dark"] .explore-card-icon-wrapper {
  background: rgba(255, 255, 255, 0.03);
}

.explore-card-info {
  flex-grow: 1;
}

.explore-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.explore-card-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.explore-card-chevron {
  color: var(--text-secondary);
  font-size: 0.85rem;
  opacity: 0.6;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.explore-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(109, 62, 245, 0.15);
  background: var(--card-bg);
}

.explore-card:hover .explore-card-icon-wrapper {
  background: var(--accent-gradient);
  color: #FFFFFF;
}

.explore-card:hover .explore-card-chevron {
  transform: translateX(4px);
  color: var(--primary-color);
  opacity: 1;
}

/* Bottom Action Buttons (Share, QR Code) */
.bottom-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
  padding-top: 0;
}

.btn-outline-custom {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 0.85rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-outline-custom:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(109, 62, 245, 0.02);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn-outline-custom:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Ripple Click Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnimation 0.6s linear;
  pointer-events: none;
}

.ripple-light {
  background: rgba(255, 255, 255, 0.4);
}

.ripple-dark {
  background: rgba(109, 62, 245, 0.15);
}

@keyframes rippleAnimation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Premium QR Code Modal */
.qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 11, 16, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.qr-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.qr-modal-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 32px 24px;
  width: 90%;
  max-width: 340px;
  text-align: center;
  box-shadow: var(--shadow-premium);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

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

.qr-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.15rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

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

.qr-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.qr-modal-description {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.qr-code-holder {
  background: #FFFFFF;
  padding: 16px;
  border-radius: 20px;
  display: inline-block;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

/* Custom Toast System */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.custom-toast {
  background: rgba(15, 15, 20, 0.92);
  color: #FFFFFF;
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  transform: translateY(20px);
  opacity: 0;
  animation: toastEntrance 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-toast.fade-out {
  animation: toastExit 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastEntrance {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.custom-toast i {
  font-size: 1.05rem;
  color: #00C2FF;
}

/* Slogan & Quote Section */
.slogan-section {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 2px;
  position: relative;
  z-index: 5;
}

.quote-icon {
  font-family: 'Poppins', sans-serif;
  font-size: 2.2rem;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: -10px;
  font-weight: 700;
  opacity: 0.85;
}

.slogan-text {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin: 0 auto 6px auto;
  max-width: 280px;
}

.slogan-line {
  width: 40px;
  height: 2px;
  background: var(--accent-gradient);
  margin: 0 auto;
  border-radius: 2px;
}

/* Social Links Row */
.social-links-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 4px;
  position: relative;
  z-index: 5;
}

.social-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(109, 62, 245, 0.3);
  background: var(--card-bg);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.social-icon-btn:hover {
  background: var(--accent-gradient);
  color: #FFFFFF !important;
  transform: scale(1.1);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

/* Responsive Overrides */
@media (max-width: 480px) {
  body {
    padding: 0;
    align-items: flex-start;
  }
  
  .card-container {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 24px 20px;
    background-size: cover; /* Use cover on mobile to avoid vertical stretching */
  }
  
  .theme-toggle-btn {
    top: 20px;
    right: 20px;
  }
  
  .explore-container {
    max-height: none;
    overflow-y: visible;
  }
}
