/* ==========================================================================
   DIGITAL BUSINESS CARD - LUXURY MATTE BLACK & GOLD DESIGN SYSTEM
   Eng. Ahmed Abdelaziz Mohamed | Electrical Power & Software Engineer
   ========================================================================== */

:root {
  /* Luxury Gold & Matte Black Palette */
  --bg-primary: #0B0B0B;
  --bg-secondary: #141414;
  --bg-card: #1A1A1A;
  --bg-card-hover: #222222;
  --bg-input: #111111;

  --gold-primary: #D4AF37;
  --gold-light: #F4DF8C;
  --gold-dark: #997A15;
  --gold-gradient: linear-gradient(135deg, #ECC855 0%, #D4AF37 50%, #8A6B12 100%);
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-border: rgba(212, 175, 55, 0.35);

  --text-main: #FFFFFF;
  --text-muted: #A3A3A3;
  --text-gold: #ECC855;

  --accent-green: #25D366; /* WhatsApp */
  --accent-blue: #0A66C2;  /* LinkedIn */
  --accent-red: #FF0000;   /* YouTube */
  --accent-orange: #FF5722;/* GrabCAD */
  --accent-github: #E6EDF3;/* GitHub */

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 8px 25px rgba(212, 175, 55, 0.2);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-family-arabic: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="light"] {
  --bg-primary: #F4F4F6;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F8FA;
  --bg-input: #EFEFEF;

  --gold-primary: #B8860B;
  --gold-light: #D4AF37;
  --gold-dark: #7A5907;
  --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #B8860B 50%, #7A5907 100%);
  --gold-glow: rgba(184, 134, 11, 0.15);
  --gold-border: rgba(184, 134, 11, 0.3);

  --text-main: #111111;
  --text-muted: #555555;
  --text-gold: #B8860B;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-gold: 0 8px 20px rgba(184, 134, 11, 0.15);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 14px 40px;
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 65%),
    radial-gradient(circle at 10% 40%, rgba(212, 175, 55, 0.03) 0%, transparent 40%);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html[dir="rtl"] body {
  font-family: var(--font-family-arabic);
}

/* Container */
.card-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

/* ==========================================================================
   Header Bar (Nav & Controls)
   ========================================================================== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-full);
}

[data-theme="light"] .top-bar {
  background: rgba(255, 255, 255, 0.85);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.brand-badge svg {
  width: 18px;
  height: 18px;
  fill: var(--gold-primary);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  font-weight: bold;
}

.btn-icon:hover {
  border-color: var(--gold-primary);
  background: var(--gold-glow);
  transform: translateY(-2px);
  color: var(--gold-primary);
}

/* ==========================================================================
   Main Card Layout
   ========================================================================== */
.card-hero {
  background: var(--bg-secondary);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  padding-bottom: 24px;
}

/* Banner Pattern */
.card-banner {
  height: 125px;
  background: linear-gradient(135deg, #111111 0%, #1e1e1e 100%);
  position: relative;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  background-image: 
    radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 60%),
    repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.02) 0, rgba(212, 175, 55, 0.02) 1px, transparent 0, transparent 20px);
}

.circuit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.12;
  background-size: cover;
  pointer-events: none;
}

/* Avatar with Gold Ring */
.avatar-wrapper {
  position: relative;
  margin: -60px auto 14px;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--gold-primary);
  box-shadow: 0 0 25px var(--gold-glow);
  background-color: #000;
  position: relative;
  z-index: 2;
  transition: transform 0.4s ease;
}

.avatar-wrapper:hover .avatar-img {
  transform: scale(1.04);
}

.online-pulse {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  background-color: #10B981;
  border: 2px solid var(--bg-secondary);
  border-radius: 50%;
  z-index: 3;
}

.online-pulse::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #10B981;
  animation: pulse-ring 2s infinite ease-out;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Hero Typography */
.hero-content {
  text-align: center;
  padding: 0 20px;
}

.engineer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 10px;
}

.engineer-badge svg {
  width: 13px;
  height: 13px;
  fill: var(--gold-primary);
}

.profile-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.profile-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.profile-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.profile-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.profile-bio {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.15);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: justify;
  text-align-last: center;
}

/* ==========================================================================
   Primary Action Buttons (Call, WhatsApp, Save VCF, Share)
   ========================================================================== */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding: 0 16px;
}

.btn-primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-gold {
  background: var(--gold-gradient);
  color: #0B0B0B;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold-primary);
  border: 1px solid var(--gold-primary);
}

.btn-outline-gold:hover {
  background: var(--gold-glow);
  transform: translateY(-2px);
  color: var(--gold-light);
}

.btn-whatsapp {
  background: #128C7E;
  color: #FFFFFF;
}

.btn-whatsapp:hover {
  background: #25D366;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.btn-full-width {
  grid-column: span 2;
}

/* ==========================================================================
   Social & Professional Networks Section
   ========================================================================== */
.section-block {
  background: var(--bg-secondary);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  padding-bottom: 10px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.social-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
  transform: translateX(4px);
}

html[dir="rtl"] .social-item:hover {
  transform: translateX(-4px);
}

.social-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-icon-box svg {
  width: 22px;
  height: 22px;
}

/* Social Icon Colors */
.icon-linkedin svg { fill: #0A66C2; }
.icon-grabcad svg { fill: #FF5722; }
.icon-youtube svg { fill: #FF0000; }
.icon-github svg { fill: #FFFFFF; }
.icon-facebook svg { fill: #1877F2; }

[data-theme="light"] .icon-github svg { fill: #111111; }

.social-info {
  display: flex;
  flex-direction: column;
}

.social-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.social-handle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.social-arrow svg {
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
  transition: transform 0.3s ease;
}

.social-item:hover .social-arrow svg {
  fill: var(--gold-primary);
  transform: translateX(3px);
}

html[dir="rtl"] .social-item:hover .social-arrow svg {
  transform: translateX(-3px);
}

/* ==========================================================================
   Specializations Grid
   ========================================================================== */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.spec-card {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.spec-card:hover {
  border-color: var(--gold-primary);
  background: var(--bg-card-hover);
}

.spec-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.spec-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
}

.spec-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gold-light);
}

.spec-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-inline-start: 38px;
}

/* ==========================================================================
   QR Code & NFC Interactive Box
   ========================================================================== */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 0;
}

.qr-box-wrapper {
  padding: 14px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  margin-bottom: 14px;
  border: 3px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

#qrcode-canvas {
  display: block;
}

.nfc-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  margin-top: 14px;
  width: 100%;
  text-align: start;
}

.nfc-icon-wave {
  width: 32px;
  height: 32px;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.nfc-text h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 2px;
}

.nfc-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Modals & Notifications
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  position: relative;
  animation: modal-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  border: 1px solid var(--gold-primary);
  box-shadow: var(--shadow-gold);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.card-footer {
  text-align: center;
  margin-top: 10px;
  padding: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-admin-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  transition: var(--transition);
}

.footer-admin-link:hover {
  text-decoration: underline;
  color: var(--gold-light);
}
