/* Grundinställningar för en luftig och modern känsla */
:root {
  --bg-color: #1a1b1e;
  --sidebar-bg: #141517;
  --text-main: #e4e5e7;
  --text-muted: #a0a0a0;
  --accent: #64ffda;
  --accent-hover: #4cdbba;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.8;
  display: flex;
}

/* Sidmenyn (Fixed) */
nav {
  width: 300px;
  background-color: var(--sidebar-bg);
  height: 100vh;
  position: fixed;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2c2e33;
}

nav h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

nav p.title {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

nav ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

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

.contact-info {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-info a {
  color: var(--text-main);
  text-decoration: none;
  display: block;
  margin-top: 0.5rem;
}

/* Huvudinnehållet */
main {
  margin-left: 300px;
  padding: 4rem 10%;
  max-width: 1200px;
}

section {
  margin-bottom: 6rem;
  padding-top: 2rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #ffffff;
  border-bottom: 2px solid #2c2e33;
  padding-bottom: 0.5rem;
  display: inline-block;
}

h3 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.job-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

ul.resume-list {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

ul.resume-list li {
  margin-bottom: 0.8rem;
}

/* Certifikat-knappar */
.cert-card {
  background-color: #25262a;
  padding: 2rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 10px 20px;
  background-color: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn:hover {
  background-color: var(--accent);
  color: var(--bg-color);
}

/* Mobilanpassning */
/* Mobilanpassning */
@media (max-width: 900px) {
  body {
    flex-direction: column;
  }
  nav {
    width: 100%;
    height: auto;
    position: sticky; /* Gör att menyn låses fast i toppen */
    top: 0;
    z-index: 1000;
    padding: 1rem 5%;
    border-right: none;
    border-bottom: 1px solid #2c2e33;
    background-color: var(
      --sidebar-bg
    ); /* Svart bakgrund så texten inte krockar */
    display: flex;
    flex-direction: column;
  }
  nav h1 {
    font-size: 1.2rem;
    margin-bottom: 0;
  }
  nav p.title,
  .contact-info {
    display: none; /* Döljs i menyn på mobilen för att spara skärmhöjd */
  }
  nav ul {
    flex-direction: row;
    overflow-x: auto; /* Låter menylänkarna skrollas i sidled */
    white-space: nowrap;
    gap: 1.5rem;
    padding-top: 0.8rem;
    padding-bottom: 0.2rem;
  }
  /* Gömmer den fula skroll-listen men behåller funktionen */
  nav ul::-webkit-scrollbar {
    display: none;
  }
  main {
    margin-left: 0;
    padding: 2rem 5%;
  }
}

/* --- Sväveffekt på jobberfarenheter och certifikat --- */
/* Uppdatera den befintliga .cert-card så här, och lägg till .job bredvid */
.cert-card,
.job {
  background-color: #25262a;
  padding: 2rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  margin-bottom: 1.5rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.job:hover,
.cert-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

/* --- Mjuka inladdningsanimationer för hela sidan --- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeSlideUp 0.8s ease-out forwards;
  opacity: 0; /* Håller sektionen osynlig tills animationen startar */
}

/* Fördröjer varje sektion lite grann för en kaskad-effekt */
section:nth-of-type(1) {
  animation-delay: 0.1s;
}
section:nth-of-type(2) {
  animation-delay: 0.3s;
}
section:nth-of-type(3) {
  animation-delay: 0.5s;
}
section:nth-of-type(4) {
  animation-delay: 0.7s;
}
section:nth-of-type(5) {
  animation-delay: 0.9s;
}
section:nth-of-type(6) {
  animation-delay: 1.1s;
}

/* --- Sidfot (Footer) --- */
footer {
  background-color: var(--sidebar-bg);
  padding: 3rem 2rem 1.5rem;
  margin-top: 4rem; /* Skapar luft mellan referenserna och sidfoten */
  border-top: 1px solid #2c2e33;
  border-radius: 8px;
  text-align: center;
  animation: fadeSlideUp 1.3s ease-out forwards;
  opacity: 0;
}

.footer-content h3 {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 0.2rem;
  border-bottom: none;
}

.footer-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap; /* Gör att länkarna hamnar på nya rader om skärmen är väldigt smal */
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--bg-color);
  background-color: var(--accent);
  padding: 0 5px;
  border-radius: 3px;
}

.footer-bottom {
  border-top: 1px solid #2c2e33;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Den flygande roboten under headern --- */
#scroll-runner {
  position: fixed;
  top: 75px; /* Flyttar ner den under din header/sidmeny */
  left: 0;
  font-size: 1.5rem;
  z-index: 999;
  pointer-events: none;
  transition: transform 0.15s ease-out;
}

/* Skapar en studsande löprörelse */
.runner {
  display: inline-block;
  animation: robotRun 0.4s infinite alternate ease-in-out;
}

@keyframes robotRun {
  0% {
    transform: translateY(0) scaleX(var(--dir, 1));
  }
  100% {
    transform: translateY(-4px) scaleX(var(--dir, 1));
  }
}
