/* ============================================================
   Palms Links — public-page.css
   Link-in-bio public page styles
   ============================================================ */

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

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --palm-deep:    #006B3F;
  --palm-green:   #00C26A;
  --palm-lime:    #7EE787;
  --palm-neon:    #39FF88;
  --mint-breeze:  #E0FBEA;
  --sand-light:   #F5FBF7;
  --charcoal:     #1A1D1E;
  --soft-grey:    #8A9A93;

  --btn-bg:       #ffffff;
  --btn-text:     var(--charcoal);
  --btn-border:   #d1dbd6;
  --page-bg:      var(--sand-light);
  --text-main:    var(--charcoal);
  --text-sub:     var(--soft-grey);
  --card-bg:      #ffffff;
  --radius-btn:   14px;
  --radius-card:  20px;

  --font-family: 'Inter', Tahoma, Arial, sans-serif;
  --transition:  220ms ease;
}

/* Dark template overrides */
.template-dark {
  --btn-bg:     #1e2b26;
  --btn-text:   #e8f0ec;
  --btn-border: #2d4035;
  --page-bg:    #0f1610;
  --text-main:  #e8f0ec;
  --text-sub:   #7a9488;
  --card-bg:    #1a2520;
}

/* ============================================================
   BASE RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--page-bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }

/* ============================================================
   PUBLIC WRAPPER
   ============================================================ */
.public-wrapper {
  max-width: 480px;
  margin-inline: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-bottom: 3rem;
}

/* ============================================================
   PAGE COVER
   ============================================================ */
.page-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.page-cover-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--palm-deep) 0%, var(--palm-green) 100%);
}

/* ============================================================
   PROFILE SECTION
   ============================================================ */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.25rem 1.5rem;
  margin-top: -44px;
  position: relative;
}

/* ============================================================
   PAGE LOGO
   ============================================================ */
.page-logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid var(--card-bg);
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  background-color: var(--card-bg);
  margin-bottom: 0.875rem;
}

.page-logo-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid var(--card-bg);
  background: linear-gradient(135deg, var(--palm-deep), var(--palm-green));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ============================================================
   PAGE NAME
   ============================================================ */
.page-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 0.375rem;
}

.page-name[lang="ar"],
.page-name.ar {
  font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
  direction: rtl;
}

/* ============================================================
   PAGE BIO
   ============================================================ */
.page-bio {
  font-size: 0.9rem;
  color: var(--text-sub);
  text-align: center;
  line-height: 1.6;
  max-width: 360px;
  margin-inline: auto;
}

.page-bio[lang="ar"],
.page-bio.ar {
  direction: rtl;
  font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
}

/* ============================================================
   LINKS SECTION
   ============================================================ */
.links-section {
  margin-top: 1.5rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ============================================================
   LINK BUTTONS
   ============================================================ */
.link-btn {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  min-height: 52px;
  border-radius: var(--radius-btn);
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition),
              box-shadow var(--transition),
              opacity var(--transition);
  cursor: pointer;
  border: none;
  width: 100%;
  gap: 0.75rem;
  background-color: var(--btn-bg);
  border: 1px solid var(--btn-border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

.link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  text-decoration: none;
}

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

.link-btn:focus-visible {
  outline: 3px solid var(--palm-green);
  outline-offset: 2px;
}

/* Link icon */
.link-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
}

.link-icon img,
.link-icon svg {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Link title */
.link-title {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  color: inherit;
}

.link-arrow {
  opacity: 0.4;
  flex-shrink: 0;
  font-size: 0.8rem;
}

/* Default (white) */
.link-btn.default {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border-color: var(--btn-border);
}

/* WhatsApp */
.link-btn.whatsapp {
  background-color: #25D366;
  color: #ffffff;
  border-color: #20b958;
}
.link-btn.whatsapp:hover {
  background-color: #1ebe59;
}

/* Phone */
.link-btn.phone {
  background-color: #006B3F;
  color: #ffffff;
  border-color: #005530;
}
.link-btn.phone:hover {
  background-color: #005530;
}

/* Email */
.link-btn.email {
  background-color: #0066CC;
  color: #ffffff;
  border-color: #0055aa;
}
.link-btn.email:hover {
  background-color: #0055aa;
}

/* Instagram */
.link-btn.instagram {
  background: linear-gradient(
    135deg,
    #833ab4 0%,
    #c13584 35%,
    #e1306c 60%,
    #f77737 100%
  );
  color: #ffffff;
  border-color: transparent;
}
.link-btn.instagram:hover {
  filter: brightness(1.08);
}

/* Twitter / X */
.link-btn.twitter {
  background-color: #000000;
  color: #ffffff;
  border-color: #333;
}

/* LinkedIn */
.link-btn.linkedin {
  background-color: #0A66C2;
  color: #ffffff;
  border-color: #0856a0;
}

/* YouTube */
.link-btn.youtube {
  background-color: #FF0000;
  color: #ffffff;
  border-color: #cc0000;
}

/* TikTok */
.link-btn.tiktok {
  background-color: #010101;
  color: #ffffff;
  border-color: #333;
}

/* Snapchat */
.link-btn.snapchat {
  background-color: #FFFC00;
  color: #000000;
  border-color: #e0e000;
}

/* Website/URL */
.link-btn.website {
  background-color: var(--palm-deep);
  color: #ffffff;
  border-color: #005530;
}

/* ============================================================
   SOCIAL ROW
   ============================================================ */
.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 0 1rem;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

.social-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
  font-size: 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.social-icon-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
  text-decoration: none;
}

.social-icon-btn:focus-visible {
  outline: 3px solid var(--palm-green);
  outline-offset: 2px;
}

.social-icon-btn img,
.social-icon-btn svg {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ============================================================
   SECTION DIVIDER
   ============================================================ */
.section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  margin: 0.25rem 0;
  color: var(--text-sub);
  font-size: 0.8125rem;
  font-weight: 500;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: currentColor;
  opacity: 0.2;
}

/* ============================================================
   TEXT BLOCK
   ============================================================ */
.text-block {
  padding: 0.75rem 1.25rem;
  margin: 0.5rem 1rem;
  background-color: var(--card-bg);
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-main);
  border: 1px solid var(--btn-border);
}

.text-block[dir="rtl"],
.text-block.rtl {
  text-align: right;
  font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
}

/* ============================================================
   IMAGE BLOCK
   ============================================================ */
.image-block {
  width: calc(100% - 2rem);
  margin: 0.5rem 1rem;
  border-radius: var(--radius-btn);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-block img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   VIDEO BLOCK
   ============================================================ */
.video-block {
  width: calc(100% - 2rem);
  margin: 0.5rem 1rem;
  border-radius: var(--radius-btn);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-block iframe,
.video-block video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ============================================================
   PAGE FOOTER
   ============================================================ */
.page-footer {
  margin-top: auto;
  padding: 1.5rem 1rem 1rem;
  text-align: center;
}

.page-footer a {
  font-size: 0.75rem;
  color: var(--text-sub);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.page-footer a:hover {
  opacity: 1;
  text-decoration: none;
}

/* ============================================================
   LANGUAGE TOGGLE
   ============================================================ */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  background-color: var(--card-bg);
  border: 1px solid var(--btn-border);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-sub);
  transition: background-color var(--transition), color var(--transition);
  text-decoration: none;
}

.lang-toggle:hover {
  background-color: var(--mint-breeze);
  color: var(--palm-deep);
  text-decoration: none;
}

.lang-toggle-wrapper {
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem 0.25rem;
}

/* Floating lang toggle */
.lang-toggle.floating {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

[dir="rtl"] .lang-toggle.floating {
  right: auto;
  left: 1rem;
}

/* Language content switching */
[data-lang] {
  display: none;
}
[data-lang].active {
  display: block;
}

/* ============================================================
   SHARE BUTTON
   ============================================================ */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background-color: var(--palm-deep);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition), transform var(--transition);
}

.share-btn:hover {
  background-color: #005530;
  transform: scale(1.03);
}

/* ============================================================
   PAGE ACTIONS ROW
   ============================================================ */
.page-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
}

/* ============================================================
   ANIMATED ENTRANCE
   ============================================================ */
.link-btn {
  animation: fadeSlideIn 0.35s ease both;
}

.link-btn:nth-child(1) { animation-delay: 0.05s; }
.link-btn:nth-child(2) { animation-delay: 0.10s; }
.link-btn:nth-child(3) { animation-delay: 0.15s; }
.link-btn:nth-child(4) { animation-delay: 0.20s; }
.link-btn:nth-child(5) { animation-delay: 0.25s; }
.link-btn:nth-child(6) { animation-delay: 0.30s; }
.link-btn:nth-child(n+7) { animation-delay: 0.35s; }

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

.public-wrapper.page-loaded .profile-section {
  animation: fadeSlideIn 0.4s ease both;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 520px) {
  .public-wrapper {
    max-width: 100%;
  }

  .page-name {
    font-size: 1.375rem;
  }
}

@media (min-width: 521px) {
  .public-wrapper {
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
    min-height: 100vh;
  }
}

/* ============================================================
   DARK TEMPLATE
   ============================================================ */
.template-dark .page-cover-placeholder {
  background: linear-gradient(135deg, #0a3d24 0%, #006B3F 100%);
}

.template-dark .link-btn {
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.template-dark .link-btn.default:hover {
  background-color: #253028;
}

.template-dark .social-icon-btn {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .link-btn,
  .public-wrapper.page-loaded .profile-section {
    animation: none;
  }

  .link-btn:hover,
  .social-icon-btn:hover {
    transform: none;
  }
}
