/* Global Variables & Reset */
:root {
  --bg-primary: #f8fafb;
  --bg-white: #ffffff;
  --bg-accent: #e8f4f8;

  --border-light: #e1e8ed;

  --text-primary: #1a2a3a;
  --text-secondary: #4a5c6a;
  --text-muted: #7a8c9a;

  --accent-teal: #0d7377;
  --accent-teal-light: #14919b;

  --font-sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-serif: 'IBM Plex Serif', Georgia, serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --border-radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, var(--accent-teal) 0.5px, transparent 0.5px);
  background-size: 24px 24px;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Header */
header {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.name {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.credentials {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-teal);
  margin-bottom: 15px;
  letter-spacing: 0.02em;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px 25px;
  font-size: 0.9rem;
  margin-top: 10px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.contact-icon {
  color: var(--accent-teal);
  width: 16px;
  text-align: center;
}

/* Summary */
.summary-section {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 24px;
  font-size: 1rem;
  color: var(--text-secondary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  /* Main left, Sidebar right */
  gap: 24px;
}

@media (max-width: 850px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Sections */
.section {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  /* overflow: hidden; Removed to allow tooltips to show */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--bg-white) 0%, rgba(248, 250, 251, 0.5) 100%);
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

.section-icon {
  color: var(--accent-teal);
  font-size: 1rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.section-body {
  padding: 0;
}

/* Entries (Experience) */
.entry {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
}

.entry:last-child {
  border-bottom: none;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5px;
  flex-wrap: wrap;
  gap: 10px;
}

.entry-role {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
}

.entry-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-teal);
  background: var(--bg-accent);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.entry-org {
  font-size: 0.95rem;
  color: var(--accent-teal-light);
  font-weight: 500;
  margin-bottom: 2px;
}

.entry-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.entry-highlights {
  list-style: none;
}

.entry-highlights li {
  position: relative;
  padding: 4px 0 4px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.entry-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background: var(--bg-accent);
  border: 2px solid var(--accent-teal);
  border-radius: 50%;
}

/* Publications */
.publication {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
}

.publication:last-child {
  border-bottom: none;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.pub-journal {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Sidebar Specifics */
.sidebar .section-body {
  padding: 20px;
}

/* Skills with Tooltips */
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 5px 10px;
  background: var(--bg-accent);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: help;
  position: relative;
  transition: all 0.2s;
}

.skill-tag:hover {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  background: #fff;
}

/* Tooltip Implementation */
.skill-tag[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  /* Dark tooltip */
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  animation: fadeIn 0.2s forwards;
  pointer-events: none;
}

.skill-tag[data-tooltip]:hover::after {
  content: '';
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--text-primary) transparent transparent transparent;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Education */
.edu-item {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--border-light);
}

.edu-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.edu-degree {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--text-primary);
}

.edu-field {
  color: var(--accent-teal);
  font-size: 0.9rem;
  margin-bottom: 2px;
}


/* Certifications */
.cert-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
  font-size: 0.9rem;
}

.cert-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cert-name {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cert-org {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cert-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-teal);
  float: right;
}

/* Print */
.print-btn {
  padding: 10px 20px;
  background: var(--accent-teal);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
}

@media print {
  body::before {
    display: none;
  }

  .page {
    padding: 0;
    max-width: 100%;
  }

  .section,
  header {
    box-shadow: none;
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  .no-print {
    display: none;
  }

  /* Ensure colors print reasonably */
  .skill-tag {
    border: 1px solid #ccc;
  }

  .entry-date {
    border: 1px solid #eee;
  }
}