/* =========================================================
   GLOBAL STYLES — Tareq Si Salem, Ph.D.
   Clean, modern, dark-mode adaptive global CSS
========================================================= */

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

/* ---------------------------------------------------------
   COLOR SYSTEM (Light / Dark via data-theme or system)
--------------------------------------------------------- */
:root {
  --primary: #2f5d8a;
  --accent: #0077b6;
  --text: #333;
  --muted: #555;
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #ddd;
  --shadow: rgba(0, 0, 0, 0.08);
}

/* Manual dark-mode override */
:root[data-theme='dark'] {
  --primary: #8ab4f8;
  --accent: #66c2ff;
  --text: #eaeaea;
  --muted: #bbb;
  --bg: #121212;
  --surface: #1e1e1e;
  --border: #333;
  --shadow: rgba(255, 255, 255, 0.05);
}

/* Auto dark mode fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --primary: #8ab4f8;
    --accent: #66c2ff;
    --text: #eaeaea;
    --muted: #bbb;
    --bg: #121212;
    --surface: #1e1e1e;
    --border: #333;
    --shadow: rgba(255, 255, 255, 0.05);
  }
}

/* ---------------------------------------------------------
   BASE TYPOGRAPHY & BODY
--------------------------------------------------------- */
body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  scroll-behavior: smooth;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
  color: var(--primary);
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

/* Utility text classes */
.highlight {
  color: var(--accent);
  font-weight: 500;
}

.italic {
  font-style: italic;
  color: var(--muted);
}

/* ---------------------------------------------------------
   NAVIGATION BAR
--------------------------------------------------------- */
header {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px var(--shadow);
  transition: background 0.3s ease;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  position: relative;
  gap: 1rem;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.nav-logo:hover {
  color: var(--accent);
}

/* Nav links */
.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-bottom 0.2s ease;
}

.nav-links a:hover,
.nav-links .active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

/* Dark mode toggle button */
.theme-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  transition: color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  transform: scale(1.15);
}

/* Hamburger button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  position: relative;
  z-index: 10; /* keep above dropdown */
}

/* ---------------------------------------------------------
   HERO SECTION
--------------------------------------------------------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2rem;
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  animation: fadeInUp 0.8s ease-out;
}

.profile-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.3s ease;
}

.profile-img:hover {
  transform: scale(1.05);
}

.intro h1 {
  font-size: 2rem;
  margin: 0.5rem 0;
}

.intro h2 {
  font-weight: 500;
  margin: 0.3rem 0;
  color: var(--muted);
}

.links a {
  color: var(--accent);
  font-weight: 500;
  margin: 0 0.3rem;
}

.links a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------
   MAIN CONTENT
--------------------------------------------------------- */
.content {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  animation: fadeInUp 0.8s ease-out;
}

.content h2,
.content h3 {
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

ul {
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.8rem;
}

.compact-list {
  margin: 0.2rem 0;
  padding-left: 1.2rem;
}

.compact-list li {
  margin: 0.1rem 0;
}

/* ---------------------------------------------------------
   PUBLICATION LIST / CARDS
--------------------------------------------------------- */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.pub-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.pub-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--shadow);
  background: var(--bg);
}

.pub-card h4 {
  margin: 0 0 0.4rem;
  color: var(--primary);
  font-size: 1.05rem;
  transition: color 0.25s ease;
}

.pub-card:hover h4 {
  color: var(--accent);
}

.pub-card p {
  margin: 0.3rem 0;
  color: var(--text);
}

.pub-card .italic {
  font-style: italic;
  color: var(--muted);
}

:root[data-theme='dark'] .pub-card {
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.05);
}

:root[data-theme='dark'] .pub-card:hover {
  background: #181818;
}

/* ---------------------------------------------------------
   FOOTER
--------------------------------------------------------- */
footer {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ---------------------------------------------------------
   ANIMATIONS
--------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------
   RESPONSIVE DESIGN
--------------------------------------------------------- */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 60px; /* below navbar */
    right: 0;
    left: 0;
    background: var(--surface);
    width: 100%;
    padding: 1rem 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 9;
  }

  .nav-links.active {
    display: flex;
  }

  .theme-toggle {
    order: 2;
  }

  .menu-toggle {
    order: 3;
  }
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Space between name and button */
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}
