/* ============================================
   Konstantinos F. Dialektopoulos — Academic Site
   Dark theme inspired by al-folio
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1e2a47;
  --bg-hover: #243352;
  --text-primary: #e0e0e0;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  --accent: #63b3ed;
  --accent-hover: #90cdf4;
  --accent-dim: rgba(99, 179, 237, 0.15);
  --highlight: #f6ad55;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1100px;
  --nav-height: 60px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-hover);
}

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

/* ---------- Navigation ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

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

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 400;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: 0.3s;
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

/* ---------- About Page Layout ---------- */
.about-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* Sidebar */
.about-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
  text-align: center;
}

.profile-photo {
  width: 200px;
  height: 200px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.photo-placeholder i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.sidebar-info h2 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  font-family: var(--font-body);
  font-weight: 600;
}

.sidebar-title {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.sidebar-affiliation {
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.social-links a:hover {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* About Content */
.about-content {
  min-width: 0;
}

.about-content > p {
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
  color: var(--text-secondary);
}

.about-content > p strong {
  color: var(--text-primary);
}

.about-content h3 {
  font-size: 1.3rem;
  margin: 2.2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

/* Interest Tags */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(99, 179, 237, 0.2);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
}

.metric-source {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.metric-source i {
  font-size: 1rem;
}

.metric-row {
  display: flex;
  gap: 2rem;
}

.metric {
  display: flex;
  flex-direction: column;
}

.metric-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metrics-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Selected Publications */
.selected-pubs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pub-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.pub-item:hover {
  border-color: var(--accent);
}

.pub-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.pub-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pub-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.pub-links a {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(99, 179, 237, 0.2);
  transition: all 0.2s;
}

.pub-links a:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.see-all-link {
  font-weight: 600;
  font-size: 0.95rem;
}

/* News List */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.news-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.news-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--highlight);
  font-weight: 500;
}

.news-text {
  color: var(--text-secondary);
}

/* ---------- Generic Page Styles ---------- */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ---------- Publications Page ---------- */
.pub-year-group h2 {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
}

.pub-entry {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  transition: all 0.2s;
}

.pub-entry:hover {
  background: var(--bg-hover);
  border-left-color: var(--highlight);
}

.pub-entry .pub-title {
  font-weight: 600;
  font-size: 0.97rem;
}

.pub-entry .pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pub-entry .pub-journal {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ---------- Talks Page ---------- */
.talk-year h2 {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
}

.talk-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.talk-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--highlight);
}

.talk-info .talk-title {
  font-weight: 600;
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
}

.talk-info .talk-venue {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.talk-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent);
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ---------- Teaching Page ---------- */
.teaching-item {
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.teaching-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 600;
}

.teaching-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.teaching-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ---------- Blog Page ---------- */
.blog-post-preview {
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.blog-post-preview:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.blog-post-preview h2 {
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
  font-family: var(--font-body);
}

.blog-post-preview h2 a {
  color: var(--text-primary);
}

.blog-post-preview h2 a:hover {
  color: var(--accent);
}

.blog-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--highlight);
  margin-bottom: 0.5rem;
  display: block;
}

.blog-excerpt {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.blog-read-more {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.6rem;
  display: inline-block;
}

/* ---------- CV Page ---------- */
.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
  margin-bottom: 2rem;
}

.cv-download:hover {
  background: var(--accent-hover);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 179, 237, 0.3);
}

.cv-section h2 {
  font-size: 1.3rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.cv-entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.cv-entry .cv-dates {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--highlight);
}

.cv-entry .cv-details h3 {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 0.15rem;
  border: none;
  padding: 0;
}

.cv-entry .cv-details p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-update {
  margin-top: 0.3rem;
  font-size: 0.75rem !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 850px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-sidebar {
    position: static;
  }

  .profile-photo {
    width: 160px;
    height: 160px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

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

  .nav-links a {
    padding: 0.7rem 1rem;
  }

  .main-content {
    padding: 2rem 1.2rem;
  }

  .cv-entry {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .talk-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

@media (max-width: 500px) {
  .profile-photo {
    width: 130px;
    height: 130px;
  }

  .metric-row {
    gap: 1rem;
  }

  .metric-number {
    font-size: 1.2rem;
  }
}

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

.about-sidebar {
  animation: fadeInUp 0.5s ease-out;
}

.about-content {
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

.pub-entry,
.talk-item,
.teaching-item,
.blog-post-preview {
  animation: fadeInUp 0.4s ease-out both;
}

/* Stagger animation for list items */
.pub-entry:nth-child(1), .talk-item:nth-child(1) { animation-delay: 0.05s; }
.pub-entry:nth-child(2), .talk-item:nth-child(2) { animation-delay: 0.1s; }
.pub-entry:nth-child(3), .talk-item:nth-child(3) { animation-delay: 0.15s; }
.pub-entry:nth-child(4), .talk-item:nth-child(4) { animation-delay: 0.2s; }
.pub-entry:nth-child(5), .talk-item:nth-child(5) { animation-delay: 0.25s; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}
