/* CSS Variables */
:root {
  --brand: #D6006D;
  --bg-top: #D6006D;
  --bg-bottom: #B10059;
  --bg-mid: #E0007A;
  --bg-light-1: #FF8EBE;
  --bg-light-2: #FFB8D6;
  --text-on-pink: #FFFFFF;
  --button-bg: #FFFFFF;
  --button-text: #FFFFFF;
  --muted: #9AA0A6;
  --shadow: 0 12px 24px rgba(0,0,0,.18);
  --shadow-soft: 0 6px 14px rgba(0,0,0,.12);
  --radius-pill: 9999px;
  --radius-round: 50%;
  --body-bg: #F2F3F5;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    /* soft highlight at top */
    radial-gradient(120% 80% at 50% -20%, var(--bg-light-2) 0%, rgba(255,184,214,0.0) 55%),
    /* mid light band */
    linear-gradient(180deg, rgba(255,142,190,0.35) 10%, rgba(255,142,190,0.0) 30%),
    /* main pink gradient */
    linear-gradient(180deg, var(--bg-light-1) 0%, var(--bg-mid) 35%, var(--bg-top) 55%, var(--bg-bottom) 100%);
  min-height: 100vh;
  color: var(--text-on-pink);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Card wrapper - now seamless */
.card {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  background: transparent;
  overflow: visible;
}

/* Language toggle */
.lang-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 4;
  background: rgba(255,255,255,.95);
  color: #111;
  border: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.lang-toggle:hover { box-shadow: var(--shadow); transform: scale(1.05); }

/* Noise overlay on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZGVmcz4KICAgIDxmaWx0ZXIgaWQ9Im5vaXNlIj4KICAgICAgPGZlVHVyYnVsZW5jZSBiYXNlRnJlcXVlbmN5PSIwLjkiIG51bU9jdGF2ZXM9IjQiIHN0aXRjaFRpbGVzPSJzdGl0Y2giLz4KICAgIDwvZmlsdGVyPgogIDwvZGVmcz4KICA8cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjbm9pc2UpIiBvcGFjaXR5PSIwLjA3Ii8+Cjwvc3ZnPg==');
  opacity: 0.07;
  pointer-events: none;
  z-index: 1;
}

/* Wave overlay on body */
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: 16%;
  height: 26%;
  background: url("data:image/svg+xml,%3Csvg width='1200' height='260' viewBox='0 0 1200 260' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs/%3E%3Cg opacity='0.62'%3E%3Cpath d='M0,130 C200,45 360,20 560,50 C760,80 920,170 1200,120 L1200,260 L0,260 Z' fill='%23ff7db7'/%3E%3C/g%3E%3Cg opacity='0.32'%3E%3Cpath d='M0,80 C190,10 380,15 570,40 C780,70 980,150 1200,110 L1200,260 L0,260 Z' fill='%23ffa3cf'/%3E%3C/g%3E%3C/svg%3E") center/cover no-repeat;
  z-index: 1;
  pointer-events: none;
  opacity: .95;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 88%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 88%);
}

/* Container */
.container {
  position: relative;
  z-index: 3;
  max-width: 420px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3rem) clamp(1rem, 4vw, 1.75rem) 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
}

/* Logo */
.logo-container {
  position: relative;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.logo {
  width: clamp(131px, 37.5vw, 188px);
  height: clamp(131px, 37.5vw, 188px);
  border-radius: var(--radius-round);
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-placeholder {
  width: clamp(131px, 37.5vw, 188px);
  height: clamp(131px, 37.5vw, 188px);
  border-radius: var(--radius-round);
  background: var(--button-bg);
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Hahmlet', 'Times New Roman', Times, serif;
  font-weight: 700;
  font-size: clamp(1.56rem, 5vw, 1.88rem);
  color: var(--brand);
}

/* Brand Title */
.brand-title {
  font-family: 'Hahmlet', 'Times New Roman', Times, serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  color: var(--text-on-pink);
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
}

/* Subtitle */
.subtitle {
  font-size: clamp(15px, 3.6vw, 18px);
  font-weight: 400;
  color: var(--text-on-pink);
  direction: rtl;
  unicode-bidi: plaintext;
  line-height: 1.6;
  margin: 0;
  opacity: 0.95;
  max-width: 100%;
  word-wrap: break-word;
  min-height: 3.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-line; /* Preserve line breaks */
}

/* Social Row */
.social-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  flex-wrap: wrap;
  direction: ltr;
}

.social-icon {
  width: clamp(40px, 10vw, 52px);
  height: clamp(40px, 10vw, 52px);
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--button-text);
  position: relative;
  overflow: hidden;
}

.social-icon:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.1);
  color: #FFFFFF;
}

.social-icon:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.social-icon svg {
  width: clamp(20px, 5vw, 24px);
  height: clamp(20px, 5vw, 24px);
  fill: currentColor;
  stroke: none;
}

/* glossy highlight for social icons */
.social-icon::before {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  top: 4px;
  height: 40%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}


/* Links Container */
.links-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 1rem;
}

/* Link Pills */
.link-pill {
  display: flex;
  align-items: center;
  padding: 0 clamp(14px, 4vw, 22px);
  height: clamp(54px, 9vw, 72px);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
  color: var(--button-text);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  direction: ltr;
}

.link-pill:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.1);
}

.link-pill:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.1), 
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.link-pill:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* glossy top highlight */
.link-pill::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 6px;
  height: 40%;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

/* Link Pill Content */
.link-pill-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px; /* 10 pixels gap between icon and text */
  width: 100%;
  direction: ltr; /* Force LTR direction for icon positioning */
  position: relative;
}

/* Link Pill Icon */
.link-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  order: 1; /* Ensure icon comes first */
  vertical-align: middle;
  line-height: 20px; /* Match text line-height */
}

.link-pill-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* icons removed inside pills */

.link-label {
  display: inline-block;
  font-size: clamp(16px, 4.2vw, 18px);
  font-weight: 600;
  text-align: center;
  color: var(--button-text);
  order: 2; /* Ensure text comes after icon */
  vertical-align: middle;
  line-height: 20px; /* Match icon height for perfect alignment */
}

/* kebab removed */

/* Responsive Design */
@media (min-width: 600px) {
  .container {
    padding: 4rem 2rem;
    gap: 2rem;
  }
  
  .links-container {
    gap: 18px;
  }
  
  .link-pill {
    height: clamp(60px, 7vw, 74px);
  }
}

@media (min-width: 960px) {
  .container {
    max-width: 520px;
    padding: 4rem 2rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .container { gap: 1.1rem; }
  .social-row { gap: 12px; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .container {
    padding: clamp(1.5rem, 4vw, 2rem) clamp(0.75rem, 3vw, 1.5rem) 1.5rem;
    gap: 1.25rem;
  }
  
  .logo {
    width: clamp(100px, 30vw, 150px);
    height: clamp(100px, 30vw, 150px);
  }
  
  .brand-title {
    font-size: clamp(24px, 4.5vw, 36px);
  }
  
  .subtitle {
    font-size: clamp(14px, 3.2vw, 16px);
  }
  
  .link-pill {
    height: clamp(48px, 8vw, 64px);
    padding: 0 clamp(12px, 3.5vw, 18px);
  }
  
  .link-pill-content {
    gap: 5px; /* Exactly 5 pixels gap between icon and text on mobile */
    justify-content: center; /* Center the content group */
  }
  
  .link-label {
    transform: translateY(2px); /* Move text down by 2 pixels on mobile */
    text-align: center; /* Center the text */
  }
  
  /* Specific text positioning for individual buttons */
  .link-pill[href*="whatsapp.com/channel"] .link-label {
    transform: translateY(3px); /* Move WhatsApp Channel text down by 3 pixels */
  }
  
  .link-pill[href*="rodinasurgery.com"] .link-label {
    transform: translateY(2px); /* Move Website text down by 2 pixels */
  }
  
  .social-icon {
    width: clamp(36px, 9vw, 48px);
    height: clamp(36px, 9vw, 48px);
  }
}

/* Wide screens - allow a slightly bigger card */
@media (min-width: 1200px) {
  .card { max-width: 520px; }
}


/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255,255,255,.9);
  margin: 20px 0 8px;
  font-size: 14px;
}

.footer a { color: inherit; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .dot { opacity: .9; }

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .link-pill:hover,
  .social-icon:hover {
    transform: none;
  }
}

/* Focus States for Keyboard Navigation */
.social-icon:focus,
.link-pill:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --shadow: 0 12px 24px rgba(0,0,0,.3);
    --shadow-soft: 0 6px 14px rgba(0,0,0,.2);
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .container {
    max-width: none;
    padding: 1rem;
  }
  
  .link-pill {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}
