/* =========================================================
   Site features — personal academic website
   ========================================================= */

/* Scroll progress */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--green-mid), var(--gold), var(--burgundy));
  z-index: 10001;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 10002;
  padding: 0.6rem 1.2rem;
  background: var(--gold);
  color: var(--green-dark);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--white);
}

/* Academic profile cards (hero + contact) */
.hero-profiles,
.contact-profiles {
  margin-top: 1.75rem;
}

.profiles-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.profile-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius-md);
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
  min-width: 0;
}

.profile-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.profile-card-mark {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--green-dark);
  color: var(--gold-light);
  border: 1px solid var(--gold-muted);
}

.profile-card--orcid .profile-card-mark {
  background: #a6ce39;
  color: #1a3d0a;
  border-color: transparent;
}

.profile-card--dergipark .profile-card-mark {
  background: var(--burgundy);
  color: var(--gold-light);
  border-color: transparent;
}

.profile-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.profile-card-desc {
  font-size: 0.68rem;
  opacity: 0.85;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-arrow svg {
  width: 18px;
  height: 18px;
  fill: var(--gold);
  opacity: 0.7;
  transition: var(--transition);
}

.profile-card:hover .profile-card-arrow svg {
  opacity: 1;
  transform: translateX(3px);
}

html[dir="rtl"] .profile-card:hover .profile-card-arrow svg {
  transform: translateX(-3px) scaleX(-1);
}

/* Contact section — light background cards */
.contact-profiles .profiles-label {
  color: var(--green-dark);
  opacity: 0.75;
}

.contact-profiles .profile-card {
  background: var(--white);
  color: var(--green-dark);
  border-color: var(--gold-muted);
  box-shadow: var(--shadow-sm);
}

.contact-profiles .profile-card:hover {
  background: var(--green-dark);
  color: var(--gold-light);
  border-color: var(--green-dark);
}

.contact-profiles .profile-card:hover .profile-card-desc {
  opacity: 0.9;
}

.contact-profiles .profile-card:hover .profile-card-mark {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold-light);
  border-color: rgba(255, 255, 255, 0.25);
}

.contact-profiles .profile-card--orcid:hover .profile-card-mark {
  background: #a6ce39;
  color: #1a3d0a;
}

/* Toolbar (theme + print) */
.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.5rem;
}

.tool-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.tool-btn:hover {
  background: var(--gold);
  color: var(--green-dark);
  border-color: var(--gold);
}

.tool-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

#navbar.scrolled .tool-btn {
  border-color: var(--gold-muted);
}

/* Copy email */
.btn-copy-email {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--cream);
  border: 1px solid var(--gold-muted);
  border-radius: 50px;
  cursor: pointer;
  color: var(--green-dark);
  transition: var(--transition);
}

.btn-copy-email:hover {
  background: var(--gold);
}

.btn-copy-email.copied {
  background: var(--green-mid);
  color: var(--white);
  border-color: var(--green-mid);
}

/* Footer meta */
.footer-updated {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.5rem;
}

/* Dark theme */
body.theme-dark {
  --cream: #1a2420;
  --cream-dark: #243029;
  --white: #1e2a25;
  --text-dark: #e8e4dc;
  --text-mid: #c5c0b5;
  --text-light: #9a958a;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
}

body.theme-dark #about,
body.theme-dark #expertise,
body.theme-dark #contact {
  background: #1e2a25;
}

body.theme-dark .info-card,
body.theme-dark .highlight-item,
body.theme-dark .expertise-card,
body.theme-dark .timeline-card,
body.theme-dark .pub-item {
  background: #243029;
  border-color: rgba(201, 162, 39, 0.2);
}

body.theme-dark .contact-profiles .profile-card {
  background: #243029;
  color: var(--gold-light);
  border-color: rgba(201, 162, 39, 0.35);
}

/* Lang switcher — 4 langs */
.lang-switcher {
  flex-wrap: wrap;
  max-width: 200px;
  justify-content: center;
}

.lang-btn[data-lang="fa"] {
  font-family: 'Vazirmatn', 'Noto Sans Arabic', sans-serif;
  font-size: 0.8rem;
}

/* RTL Persian */
html[dir="rtl"] body {
  font-family: 'Vazirmatn', 'Amiri', 'Noto Sans Arabic', var(--font-sans);
}

html[dir="rtl"] .section-title,
html[dir="rtl"] .hero-name,
html[dir="rtl"] .wisdom-quote p {
  font-family: 'Amiri', 'Vazirmatn', serif;
}

@media (max-width: 900px) {
  .profile-cards {
    grid-template-columns: 1fr;
  }

  .profile-card-desc {
    white-space: normal;
  }

  .nav-tools {
    position: absolute;
    top: 1rem;
    right: 4rem;
  }

  html[dir="rtl"] .nav-tools {
    right: auto;
    left: 4rem;
  }
}

@media print {
  #navbar,
  .lang-switcher,
  .nav-tools,
  #scroll-progress,
  #back-to-top,
  .skip-link,
  .nav-toggle {
    display: none !important;
  }

  section { break-inside: avoid; }
}
