/* Unified Stylesheet for Diplomatic Profile Card */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Executive Diplomatic Theme */
  --bg-gradient: linear-gradient(135deg, #0b1329 0%, #101b3b 40%, #0d152e 100%);
  --bg-card: rgba(22, 33, 62, 0.75);
  --bg-card-hover: rgba(30, 44, 79, 0.85);
  --glass-border: rgba(212, 175, 55, 0.25);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-gold: #e6c666;
  --text-gold-light: #fbe396;
  
  --gold-primary: #d4af37;
  --gold-gradient: linear-gradient(135deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%);
  --gold-gradient-hover: linear-gradient(135deg, #cba24c 0%, #fff6c5 25%, #c09435 50%, #fff5c4 75%, #b78429 100%);
  
  --emerald-accent: #10b981;
  --crimson-accent: #ce1126;
  
  --btn-bg: rgba(255, 255, 255, 0.07);
  --btn-bg-hover: rgba(212, 175, 55, 0.15);
  --btn-border: rgba(255, 255, 255, 0.12);
  
  --font-ar: 'Cairo', 'Tajawal', sans-serif;
  --font-en: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #cbd5e1 100%);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(180, 140, 20, 0.3);
  --glass-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-gold: #9a7314;
  --text-gold-light: #78580c;
  
  --btn-bg: rgba(15, 23, 42, 0.04);
  --btn-bg-hover: rgba(180, 140, 20, 0.12);
  --btn-border: rgba(15, 23, 42, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text-main);
  font-family: var(--font-ar);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 12px;
  position: relative;
  overflow-x: hidden;
}

body.lang-en {
  font-family: var(--font-en);
}

/* Background Animated Glows */
.bg-glow-1, .bg-glow-2 {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

.bg-glow-1 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #ce1126 0%, transparent 70%);
  top: -50px;
  left: -50px;
  animation: float-glow 12s infinite alternate ease-in-out;
}

.bg-glow-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #d4af37 0%, transparent 70%);
  bottom: -80px;
  right: -80px;
  animation: float-glow 15s infinite alternate-reverse ease-in-out;
}

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

/* Main Container */
.profile-wrapper {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
}

/* Header Action Bar */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.nav-btn {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  color: var(--text-gold);
}

.nav-btn i {
  font-size: 1.1rem;
}

/* Profile Card Container */
.profile-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

/* Top Emblem & Banner */
.embassy-banner {
  text-align: center;
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.embassy-banner::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: var(--gold-gradient);
  border-radius: 2px;
}

.emblem-wrapper {
  width: 90px;
  height: 90px;
  margin: 0 auto 14px auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emblem-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
  animation: pulse-emblem 3s infinite ease-in-out;
}

@keyframes pulse-emblem {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.08); }
}

.emblem-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.embassy-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-gold);
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.embassy-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* Personal Info Header */
.person-header {
  text-align: center;
  margin-bottom: 28px;
}

.person-name {
  font-size: 1.85rem;
  font-weight: 900;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  line-height: 1.3;
}

.person-title {
  display: inline-block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 6px 16px;
  border-radius: 20px;
  margin-top: 4px;
}

/* Quick Action Grid Buttons */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

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

.action-circle-btn i {
  font-size: 1.35rem;
  color: var(--text-gold);
  transition: var(--transition);
}

.action-circle-btn span {
  font-size: 0.75rem;
  font-weight: 700;
}

.action-circle-btn:hover {
  background: var(--btn-bg-hover);
  border-color: var(--gold-primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.2);
}

.action-circle-btn:hover i {
  transform: scale(1.15);
  color: var(--text-gold-light);
}

/* Main Contact Details List */
.contact-details-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.contact-item {
  display: flex;
  align-items: center;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: var(--transition);
  position: relative;
}

.contact-item:hover {
  background: var(--btn-bg-hover);
  border-color: rgba(212, 175, 55, 0.35);
  transform: translateX(0);
}

.contact-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-gold);
  font-size: 1.2rem;
  margin-left: 14px; /* RTL default */
}

body.lang-en .contact-icon {
  margin-left: 0;
  margin-right: 14px;
}

.contact-text-wrap {
  flex: 1;
  overflow: hidden;
}

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

.contact-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  word-break: break-word;
  direction: ltr; /* Keeps telephone numbers correctly formatted (+202) ... */
  display: inline-block;
}

body.lang-ar .contact-value {
  text-align: right;
}

body.lang-en .contact-value {
  text-align: left;
}

.contact-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition);
}

.contact-copy-btn:hover {
  color: var(--text-gold);
  background: rgba(255, 255, 255, 0.1);
}

/* Large CTA Buttons Section */
.cta-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-primary-gold {
  background: var(--gold-gradient);
  color: #0b1329;
  border: none;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-decoration: none;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
  transition: var(--transition);
}

.btn-primary-gold:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.45);
}

.btn-secondary-glass {
  background: var(--btn-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-decoration: none;
  transition: var(--transition);
}

.btn-secondary-glass:hover {
  background: var(--btn-bg-hover);
  border-color: var(--gold-primary);
  color: var(--text-gold);
  transform: translateY(-2px);
}

/* Card Visual Showcase / Flip Section */
.card-preview-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed rgba(212, 175, 55, 0.2);
  text-align: center;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 3D Physical Business Card Flip */
.physical-card-container {
  perspective: 1000px;
  width: 100%;
  max-width: 420px;
  height: 230px;
  margin: 0 auto;
  cursor: pointer;
}

.physical-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.physical-card-container.flipped .physical-card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: #ffffff;
  padding: 16px 20px;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.card-face-back {
  transform: rotateY(180deg);
}

/* Mini Mock of Original Card */
.mini-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.mini-logo-box {
  width: 45px;
  text-align: center;
}

.mini-logo-box img {
  width: 38px;
  height: 38px;
}

.mini-embassy-name {
  font-size: 0.65rem;
  font-weight: 800;
  color: #111;
  line-height: 1.2;
}

.mini-person-info {
  text-align: left;
}

body.lang-ar .card-face-front .mini-person-info {
  text-align: right;
}

.mini-person-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #000;
  font-family: var(--font-ar);
}

.mini-person-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: #333;
}

.mini-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.62rem;
  color: #222;
  border-top: 1px solid #eee;
  padding-top: 8px;
}

.mini-contact-list {
  direction: ltr;
  font-weight: 600;
  line-height: 1.3;
}

.flip-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Footer Copyright */
.profile-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modal Popup (QR Code) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

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

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: var(--glass-shadow);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

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

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition);
}

body.lang-ar .modal-close-btn {
  right: auto;
  left: 16px;
}

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

.qr-code-img {
  width: 200px;
  height: 200px;
  margin: 18px auto;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #fff;
  border: 1px solid var(--gold-primary);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* Responsive tweaks */
@media (max-width: 480px) {
  .profile-card {
    padding: 24px 18px;
  }
  
  .person-name {
    font-size: 1.55rem;
  }

  .quick-actions {
    gap: 8px;
  }

  .action-circle-btn {
    padding: 12px 6px;
  }
}
