/* Root variables */
:root {
  --primary-color: rgb(132, 94, 194);
  --secondary-color: rgb(214, 93, 177);
  --accent-color: rgb(255, 150, 113);
  --accent-color2: rgb(255, 253, 208);
  --secondary-color2: #fff;
  --secondary-color3: #fff8dc;
  --secondary-color4: #000;
  --text-color1: #000;
  --text-color2: #fff;
  --color-1: #fff;
  --color-4: #36454f;

  --font-family: "Nunito", sans-serif;
  --font-size1: 1rem;
  --font-size2: 2rem;
  --line-height: 1.6;
}

html {
  scroll-behavior: smooth;
}

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

html,
body {
  overflow-x: hidden;
}

/* Header & Navigation */
header {
  height: 20vh;
  background-image: linear-gradient(
    180deg,
    var(--primary-color) 0%,
    var(--secondary-color) 35%,
    var(--accent-color) 100%
  );
}

.topnav-content {
  /* följer med vid scrollning */
  position: sticky;
  top: 0;
  z-index: 1000;

  /* Position */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
  width: 100%;

  /* Glassy effekt för navbar */
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10.6px);
  -webkit-backdrop-filter: blur(10.6px);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.topnav-content ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.topnav-content ul li a {
  text-decoration: none;
  color: var(--text-color1);
  font-weight: bold;
  font-family: var(--font-family);
  text-transform: uppercase;
  padding: 5px 15px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.topnav-content ul li a:hover {
  background-color: var(--accent-color);
  color: var(--color-1);
  text-shadow: 0 0 10px;
}

/* Hero section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  width: 100%;
  min-height: 80vh;
  background-color: var(--accent-color);
  font-family: var(--font-family);
}

.hero img {
  width: 150px;
  height: 150px;
  border-radius: 10px;
  object-fit: cover;
  border: 6px solid var(--color-4);
}

.hero h1,
.hero h2 {
  color: var(--color-1);
  text-shadow: 0 0 10px;
}

.hero p {
  font-size: var(--font-size1);
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--color-1);
}

/* Main / About Section */
main {
  background-color: black;
  padding: 40px 20px;
  font-family: var(--font-family);
}

.about-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Cards */
.card-1,
.card-2 {
  width: 100%;
  max-width: 600px;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 10px;
  background-color: var(--secondary-color2);

  transition: transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.card-1:hover,
.card-2:hover {
  transform: translateY(-5px);
}

.card-1 h2,
.card-2 h2 {
  font-size: var(--font-size2);
  text-align: center;
  margin-bottom: 15px;
  color: var(--text-color1);
}

.card-1 p {
  font-size: var(--font-size1);
  text-align: justify;
  line-height: var(--line-height);
  color: var(--text-color1);
  line-height: 1.2;
  margin: 10px 0;
}

/* Card 2 table */
.card-2 table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  text-align: center;
}

.card-2 th,
.card-2 td {
  padding: 10px;
  border: 1px solid black;
}

.card-2 th {
  background-color: var(--color-4);
  color: var(--text-color2);
}

.card-2 p {
  text-align: center;
  margin-top: 10px;
  font-size: var(--font-size1);
  color: var(--text-color1);
}

/* Project section */
.project-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 20px;
}

.project-section h2 {
  font-size: var(--font-size2);
  text-align: center;
  color: var(--color-1);
  margin-bottom: 20px;
}
/* Project card  */
.project-card {
  max-width: 600px;
  width: 100%;
  padding: 20px;
  background-color: var(--secondary-color2);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  text-align: center;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card h3 {
  font-size: var(--font-size2);
  margin-bottom: 10px;
  color: var(--text-color1);
}

.project-card p {
  font-size: var(--font-size1);
  color: var(--text-color1);
  line-height: var(--line-height);
}

/* Contact Section */
.contact-section {
  background-color: var(--secondary-color3);
  padding: 40px 20px;
  max-width: 700px;
  margin: 0 auto 80px auto;
  border-radius: 10px;
  text-align: center;
  font-family: var(--font-family);
  color: var(--text-color1);
}

.contact-section h2 {
  font-size: var(--font-size2);
  margin-bottom: 20px;
}

.contact-section p {
  font-size: var(--font-size1);
  margin-bottom: 20px;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--secondary-color4);
  font-size: var(--font-size1);
  width: 100%;
  box-sizing: border-box;
}

/* Contact Form Button */
.contact-form button {
  padding: 12px;
  border-radius: 10px;
  border: none;
  background-color: var(--primary-color);
  color: var(--color-1);
  font-size: var(--font-size1);
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: var(--accent-color);
}

/* Contact Info */
.contact-info {
  margin: 5px 0;
  font-size: var(--font-size1);
}

/* Map Container */
.map-container {
  margin-top: 20px;
  border-radius: 10px;
}

/* For google map style */
.map-container iframe {
  width: 100%;
  height: 300px;
  border: 0;
  border-radius: 10px;
}

/* Footer */

footer {
  padding: 20px;
  background-color: var(--secondary-color2); /* white background for contrast */
  font-family: var(--font-family);
  color: var(--text-color1);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allow responsiveness */
  max-width: 1200px;
  margin: 0 auto;
}

/* Each section (Social & Resources) styling */
.footer-section {
  display: flex;
  flex-direction: column;
  align-items: center; /* Center items horizontally */
  justify-content: center; /* Center vertically within section */
  flex: 1; /* Equal spacing */
  padding: 10px;
  text-align: center;
}

/* Headings styles */
h2 {
  font-size: var(--font-size2);
  color: var(--primary-color);
  margin-bottom: 0.5em;
}
h3 {
  font-size: calc(var(--font-size1) * 0.9);
  margin-bottom: 1em;
}

/* List styles */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Icon links styling */
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 10px 0;
  transition: transform 0.2s, color 0.2s;
  cursor: pointer;
  color: var(--primary-color);
}
.icon-link:hover {
  transform: scale(1.2);
  color: var(--accent-color);
}

/* Ion icon styling (adjust size) */
.icon-link ion-icon {
  font-size: 40px;
}

footer p {
  margin-top: 20px;
  font-size: var(--font-size1);
  color: var(--text-color1);
}
footer a {
  color: var(--primary-color);
  text-decoration: none;
  margin: 0 10px;
}
footer a:hover {
  text-decoration: underline;
}

/* Back To Top Button - Basic Design */
#backToTopBtn {
  position: fixed;
  bottom: 70px;
  right: 30px;
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, #ff6a00, #d800ff, #ff0099);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 20px;
  cursor: pointer;

  display: flex; /* ✅ alltid aktiv layout */
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  padding: 0 16px;

  box-shadow: 0 0 12px rgba(255, 60, 150, 0.6);

  /* ✅ Döljs på ett korrekt sätt */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  /* Animationer */
  transition: width 0.35s ease, background-position 0.6s ease, opacity 0.3s ease,
    visibility 0.3s ease, box-shadow 0.3s ease;
}

/* Texten i knappen döljs först */
#backToTopBtn span:last-child {
  opacity: 0;
  white-space: nowrap;
  font-size: 14px;
  transition: opacity 0.3s ease;
}

/* ✅ När JS lägger till .show */
#backToTopBtn.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Hover-effekt: Bredare + visar text */
#backToTopBtn:hover {
  width: 150px;
  background-position: right center;
  box-shadow: 0 0 18px rgba(255, 0, 200, 0.8);
}

#backToTopBtn:hover span:last-child {
  opacity: 1;
}

/* Back to Top Button */
/* KLAR*/

/* Dark/light mode button */

#themeBtn {
  position: fixed;
  bottom: 140px; /* ovanför back-to-top */
  right: 30px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(135deg, #1e1e2f, #6c63ff);
  box-shadow: 0 0 15px rgba(108, 99, 255, 0.5);
  transition: all 0.3s ease;
  z-index: 1001;
}

#themeBtn:hover {
  transform: scale(1.12) rotate(8deg);
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.8);
}

/*  LIGHT MODE */
body.light-mode {
  background-color: #fdfdfd;
  color: #111;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Header / Navbar */
body.light-mode header {
  background: linear-gradient(180deg, #fff0b3 0%, #ffd6cc 50%, #ffe4ec 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/*  Hero Section */
body.light-mode .hero {
  background: linear-gradient(135deg, #fff7da, #ffe5d9, #ffd6e0);
  color: #222;
  text-shadow: none;
  padding: 60px 20px;
  border-radius: 0 0 30px 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transition: background 0.4s ease, color 0.4s ease;
}

body.light-mode .hero h1,
body.light-mode .hero h2 {
  color: #333;
}

body.light-mode .hero p {
  color: #444;
}

/* Main Content */
body.light-mode main {
  background-color: #fff;
}

/*  Cards (About, Skills, Projects) */
body.light-mode .card-1,
body.light-mode .card-2,
body.light-mode .project-card {
  background-color: #ffffff;
  color: #222;
  border: 1px solid #eee;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

body.light-mode .card-1:hover,
body.light-mode .card-2:hover,
body.light-mode .project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/*  Footer */
body.light-mode footer {
  background-color: #f7f7f7;
  color: #111;
  border-top: 1px solid #ddd;
}

/*  Light mode button look */
body.light-mode #themeBtn {
  background: linear-gradient(135deg, #ffcc33, #ff9966);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 165, 0, 0.6);
}

body.light-mode #themeBtn:hover {
  transform: scale(1.12) rotate(-8deg);
  box-shadow: 0 0 20px rgba(255, 136, 0, 0.8);
}

/*Text typing effekt för texten under bild hero section */

#typing-textP {
  text-shadow: 0 0 10px rgba(255, 0, 200, 0.7), 0 0 20px rgba(255, 100, 0, 0.5);
}

#typing-textP::after {
  content: "|";
  animation: blink 0.8s infinite;
  color: var(--color-1);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Scroll animation for sections */

/* Döljer section/element innan scroll */
.hidden {
  opacity: 0;
  transform: translateY(80px) rotateX(25deg) scale(0.9); /* Ner, minskar, lutar i 3D */
  filter: blur(15px) brightness(0.6); /* Blur */
  transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1); /*Mjuk Rörelsekurva(cubic bezier)  */
  will-change: transform, opacity, filter; /*Webbläsaren förbereder sig för animation inga laggs  */
}

/*Syns i bild vid scrolling   */
.show {
  opacity: 1;
  transform: translateY(0) rotateX(0deg) scale(1); /* Tillbaka till normal position */
  filter: blur(0) brightness(1);
  animation: entryGlow 1.4s ease-out forwards; /*glow pop effekt mot skärmen   */
}

/* Card-1 kommer in från vänster(3D) */
.card-1.hidden {
  transform: translateX(-120vw) rotateY(45deg) scale(0.8);
}

.card-1.show {
  transform: translateX(0) rotateY(0deg) scale(1);
}

/* Card-2 kommer in från vänster(3D) */
.card-2.hidden {
  transform: translateX(120vw) rotateY(-45deg) scale(0.8);
}

.card-2.show {
  transform: translateX(0) rotateY(0deg) scale(1);
}

/*Project-card – flyger in underifrån  */
.project-card.hidden {
  transform: translateY(80vh) rotateX(-25deg) scale(0.7);
}
.project-card.show {
  transform: translateY(0) rotateX(0deg) scale(1);
}

@keyframes entryGlow {
  0% {
    box-shadow: 0 0 0 rgba(255, 0, 150, 0); /* Ingen glow i början */
  }
  50% {
    box-shadow: 0 0 60px rgba(255, 0, 200, 0.8),
      0 0 100px rgba(255, 150, 0, 0.5); /* Kraftig glow mitt i */
  }
  100% {
    box-shadow: 0 0 15px rgba(255, 0, 200, 0.2); /* Mjuk glow kvar på slutet */
  }
}

/* responsiveness*/
@media (max-width: 768px) {
  /* Navigation: vertikal meny och centrering */
  header {
    height: auto;
    padding: 10px 0;
  }
  .topnav-content {
    flex-direction: column;
    align-items: center;
  }
  .topnav-content ul {
    flex-direction: column;
    gap: 1rem;
    padding: 10px 0;
  }

  /* Hero sektion: centrera och minska bildstorlek */
  .hero {
    padding: 20px;
  }
  .hero img {
    width: 120px;
    height: 120px;
  }
  .hero h1,
  .hero h2 {
    font-size: 1.5rem;
  }
  .hero p {
    font-size: 1rem;
  }

  .about-section,
  .project-section {
    padding: 20px;
  }

  /* Cards: full width på mindre skärmar */
  .card-1,
  .card-2,
  .project-card {
    max-width: 100%;
  }

  /* Tabeller: scrollbar för att visa hela tabellen på små skärmar */
  table {
    display: block;
    overflow-x: auto;
  }

  .contact-form {
    gap: 10px;
  }
  .contact-form input,
  .contact-form textarea {
    width: 100%;
  }

  /* Map: anpassa höjden för mobil */
  .map-container iframe {
    height: 200px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
  }
  .footer-section {
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
  }

  /* Ikoner och sociala länkar */
  .icon-link {
    font-size: 30px;
  }
}

@media (max-width: 480px) {
  .icon-link {
    font-size: 25px;
  }
  .hero h1,
  .hero h2 {
    font-size: 1.2rem;
  }

  main,
  footer {
    padding: 20px;
  }
}
#welcome-msg {
  font-weight: bold;
  font-family: "Nunito", sans-serif;
  text-align: center;
  font-size: 1.1rem;
}

/* KLAR */
