/* =========================================================
   main.css — Evangelos-Marios Nikolados Personal Website
   ========================================================= */

/* --------- COLOR VARIABLES --------- */
:root {
  --bg-color: #fafafa;
  --text-color: #1e1e1e;
  --card-bg: #ffffff;
  --border-color: #e2e2e2;
  --accent: #008b8b;
  --accent-hover: #007070;
  --shadow-light: rgba(0, 0, 0, 0.05);

  /* extras for the GitHub activity backdrop pattern */
  --grid-dot: rgba(0,0,0,0.06);
  --grid-line: rgba(0,0,0,0.04);
}

body.dark-mode {
  --bg-color: #121212;
  --text-color: #e5e5e5;
  --card-bg: #1e1e1e;
  --border-color: #2a2a2a;
  --accent: #00c9c9;           /* brighter teal for pro contrast in dark mode */
  --accent-hover: #00aeb0;
  --shadow-light: rgba(0, 0, 0, 0.6);

  --grid-dot: rgba(255,255,255,0.10);
  --grid-line: rgba(255,255,255,0.06);
}

/* --------- GLOBAL RESET & BASE --------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

h1, h2, h3, h4 {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  color: var(--text-color);
  transition: color 0.3s ease;
}
h1 { font-size: 2.4rem; margin-bottom: 0.3em; }
h2 { font-size: 1.5rem; font-weight: 400; color: #666; margin-bottom: 1.5em; }
h3 {
  font-size: 1.3rem;
  margin-bottom: 1em;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.2em;
}
h4 { font-size: 1.1rem; margin-bottom: 0.3em; }
p { margin-bottom: 0.9em; }

/* --------- PAGE CONTAINER --------- */
.content {
  max-width: 1050px;
  margin: 0 auto;
  padding: 50px 25px 60px 25px;
}

/* --------- HEADER --------- */
header {
  text-align: center;
  margin-bottom: 3em;
  position: relative;
}

/* Floating theme toggle (professional app style) */
#theme-toggle {
  position: absolute;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 10;
  padding: 8px 14px;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent);
  box-shadow: 0 4px 12px var(--shadow-light);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
body.dark-mode #theme-toggle {
  background-color: rgba(18, 18, 18, 0.7);
  border-color: #2e2e2e;
  color: var(--accent);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}
#theme-toggle:hover { transform: translateY(-1px); }
#theme-toggle:active { transform: translateY(0); }

/* --------- INTRO SECTION --------- */
.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 3em;
  gap: 2rem;
}

.intro-text { flex: 1 1 580px; }
.intro-text p { margin-bottom: 1.1em; max-width: 720px; }

.intro-photo { flex: 0 0 320px; text-align: center; }

.intro-photo img,
.profile-pic {
  width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 12px var(--shadow-light);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --------- SOCIAL ICONS --------- */
.social-icons { margin-top: 1.5em; }
.social-icons a { display: inline-block; margin-right: 14px; }
.social-icons img {
  width: 32px; height: 32px;
  filter: grayscale(100%);
  transition: 0.3s ease;
}
.social-icons img:hover { filter: none; transform: scale(1.1); }

/* --------- SKILLS SECTION --------- */
.skills { margin-top: 3em; margin-bottom: 3em; }
.skills-columns { display: flex; flex-wrap: wrap; gap: 2rem; }
.skills-columns > div {
  flex: 1;
  min-width: 200px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 1rem 1.2rem;
  box-shadow: 0 2px 4px var(--shadow-light);
  transition: box-shadow 0.2s ease, background-color 0.3s ease;
}
.skills-columns > div:hover { box-shadow: 0 3px 8px rgba(0,0,0,0.15); }
.skills-columns h4 { color: var(--accent); margin-bottom: 0.4em; }

/* --------- EDUCATION + EXPERIENCE --------- */
.edu-exp {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  margin-top: 3em;
  margin-bottom: 3em;
}
.edu-exp .column {
  flex: 1 1 480px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.8rem;
  box-shadow: 0 2px 6px var(--shadow-light);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.edu-exp p { margin-bottom: 1em; font-size: 0.97rem; }
.edu-exp em { font-style: italic; color: #888; }
.edu-exp b { color: var(--text-color); }

/* --------- PROJECTS --------- */
.projects { margin-top: 3em; margin-bottom: 4em; }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5em;
}
.projects-grid > div {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 1.3rem 1.5rem;
  box-shadow: 0 2px 5px var(--shadow-light);
  transition: 0.25s ease;
}
.projects-grid > div:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.projects h4 { color: var(--accent); margin-bottom: 0.5em; }

/* --------- GITHUB ACTIVITY WIDGET --------- */
#github-activity { margin-top: 3em; }
#github-activity picture,
#github-activity img {
  display: block;
  width: 100%;
}

#github-activity img {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px var(--shadow-light);

  /* 🔧 Visual polish */
  border-top: 3px solid var(--accent);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.3s ease, background 0.3s ease;

  /* Optional soft grid pattern behind the SVG (subtle, theme-aware) */
  background-image:
    radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0),
    linear-gradient(var(--grid-line), var(--grid-line));
  background-size: 18px 18px, 100% 100%;
  background-blend-mode: overlay;
}
#github-activity img:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
@media (prefers-reduced-motion: reduce) {
  #github-activity img { transition: none; }
}

/* --------- PUBLICATIONS --------- */
#publications { margin-top: 3em; }
.pub-card {
  background-color: var(--card-bg);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin-bottom: 0.3rem;
  border-radius: 5px;
  box-shadow: 0 1px 2px var(--shadow-light);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.pub-card p { margin: 0.2em 0; font-size: 0.95rem; color: var(--text-color); }

/* ✅ Title-with-icon layout (for ORCID beside "Selected Publications") */
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Prefer this: a mask-painted badge that always matches site colors */
.orcid-badge {
  width: 18px;
  height: 18px;
  display: inline-block;
  background-color: var(--text-color); /* monochrome to match GitHub/LinkedIn/Scholar look */
  -webkit-mask: url('images/orcid.logo.icon.svg') no-repeat center / contain;
  mask: url('images/orcid.logo.icon.svg') no-repeat center / contain;
  vertical-align: -3px;
  opacity: 0.9;
}

/* Fallback if the icon is inserted as an <img class="orcid-icon" ...> */
.orcid-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.9;
}

/* --------- CONTACT SECTION & FORM --------- */
#contact {
  margin: 3em auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem 2.5rem;
  box-shadow: 0 2px 6px var(--shadow-light);
  max-width: 640px;
  text-align: center;
  border-top: 3px solid var(--accent);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ✅ Stacking + full-width fields (fix for collapsed inline layout) */
.contact-form {
  max-width: 480px;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
}
.contact-form label {
  display: block;
  font-weight: 500;
  color: var(--text-color);
  text-align: left;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,139,139,0.15);
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form button {
  margin-top: 0.8rem;
  background-color: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.05s ease;
}
.contact-form button:hover { background-color: var(--accent-hover); }
.contact-form button:active { transform: translateY(1px); }

/* --------- FOOTER --------- */
footer {
  margin-top: 2em;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1em;
  transition: color 0.3s ease;
}
footer a { color: var(--accent); }

/* --------- RESPONSIVE DESIGN --------- */
@media (max-width: 900px) {
  .intro-photo img { width: 260px; height: 260px; }
}

@media (max-width: 800px) {
  /* Stack & center intro; image first */
  .intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.2rem; /* tighter rhythm */
  }
  .intro-photo {
    order: -1;                 /* ✅ move image above text */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
  .intro-photo img {
    width: 260px;
    height: 260px;
    margin-top: 0;             /* remove awkward gap */
    margin-bottom: 1rem;
    border-radius: 10px;
  }

  .social-icons { margin-top: 0.8em; }

  .edu-exp { flex-direction: column; }
  .skills-columns { flex-direction: column; }

  #publications .pub-card { padding: 0.6rem 0.8rem; }
  #contact { padding: 1rem; }
}

@media (max-width: 640px) {
  /* extra headroom so the floating toggle never overlaps the H1 on mid phones */
  header { padding-top: 42px; }
}

@media (max-width: 480px) {
  body { font-size: 16px; line-height: 1.45; }
  .content { padding: 35px 15px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.2rem; }

  .intro-photo img {
    width: 240px;
    height: 240px;
  }

  .social-icons img { width: 28px; height: 28px; }
}
