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

header {
  width: 100%;
  background-color: hsl(235, 36%, 46%); /* opcionalno pozadina */
  padding: 1rem 2rem;
  font-family: "Red Hat Display";
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* tarvitaan mobiilissa */
  box-sizing: border-box;
}

.nav {
  display: flex;
  gap: 3rem; /* etäisyys  Projects, About, Contact  välillä*/
  /* justify-content: flex-end; */
  align-items: center;
}

.nav a {
  /*margin: 0;*/
  cursor: pointer;
  font-size: 1rem;
  color: white;
  position: relative; /*eventualno moje i bez tova*/
  text-decoration: none;
}
.nav a,
.theme-toggle {
  height: 20px; /* същата височина като логото */
  display: flex;
  align-items: center;
}

.nav a::after {
  /*aleviivattu*/
  content: "";
  width: 0;
  height: 2px;
  background-color: rgb(135, 219, 250);
  transition: width 0.5s ease;
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.nav a:hover::after {
  width: 100%;
}

#projectsSelect {
  /*piilotettu Projects takana*/
  display: none;
}

select,/*koko selecti on laatikossa*/
  label {
  display: block;
  margin-top: 10px;
}

.logo img {
  width: 40px; /* можеш да променяш размера */
  height: auto;
}

/*-------------------------Background image-------------------------------*/
.hero {
  position: relative;
  display: flex;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  align-items: center;
  height: 45vh;
  color: #fff;
}
.hero img {
  position: absolute; /*tekee niin että kuva ei peiteisi header*/
  top: 0;
  left: 0;
  width: 100%; /* 100% viewport leveys*/
  height: 100%;
  object-fit: cover; /* Täyttää valinnaisesti koko leveyden vääristymättä*/
  z-index: -1;
}
/* #backgrImage-text {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -40%);
  text-align: center;
  color: white;
} */

#backgrImage-text {
  position: static;
  top: 40%;
  left: 50%;
  transform: none;
  text-align: center;
  color: white;
}

@keyframes fadeIn {
  /*sulavat siirtymät*/
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#backgrImage-text h1,
#backgrImage-text p {
  animation: fadeIn 1s ease forwards;
}

/*-----------------------------------------------------------------------------*/
body {
  background-color: hsl(195, 100%, 75%);
  font-family: "Red Hat Display", sans-serif;
  transition: background-color 0.3s, color 0.3s; /**/
}
/*------------------Vaalea/tumma teemanvaihtaja -------------------------------*/
.center-box {
  height: 30vh; /* Височина на целия екран */
  display: flex;
  flex-direction: column; /* Подреди елементите вертикално */
  justify-content: center; /* Центриране вертикално */
  align-items: center; /* Центриране хоризонтално */
  text-align: center;
  gap: 20px; /* Разстояние между h1, p и бутона */
}

body.light-theme {
  /**/
  background-color: rgb(135, 219, 250);
  color: #000000;
}

body.dark-theme {
  /**/
  background-color: #121212;
  color: #ffffff;
}

.theme-toggle {
  /* theme nappula */
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 20px;
}

/*------------------------------------------------------*/
.container {
  padding: 40px;
  color: hsl(235, 36%, 46%);
}

.container h2 {
  color: hsl(235, 36%, 46%);
}

.project-container {
  display: flex; /* jätjästää kaikki vieräkkäin horizontaalilla linjalla */
  justify-content: center; /* keskelle*/
  gap: 30px; /* tila projectien välillä */
  flex-wrap: wrap; /* jos näyttö on pieni,että kuvat putoavat toselle riville */
  padding: 20px;
}
/*projectin valokuva*/
.image-container {
  position: relative;
  display: inline-block;
}

.image-container img {
  display: block;
  width: 300px;
  height: 200px;
  border-radius: 8px;
}

/* GitHub in linkki kuvan keskellä */
.overlay-link {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  background: hsl(235, 36%, 46%);
  padding: 10px 20px;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  border-radius: 6px;
  opacity: 1; /* <-- ВИНАГИ ВИДИМ */
  /*opacity: 0;
  transition: opacity 0.3s ease;*/
}

/* Показва линка при hover zaedno s opacity: 0 i  transition 0.3s ease
.image-container:hover .overlay-link {
  opacity: 1;
}*/

/*-----------------------*/
.project {
  background: hsl(235, 36%, 46%);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  width: 300px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.project h3 {
  margin: 15px 0 10px;
  color: white;
}
.project a {
  display: inline-block;
  margin-bottom: 15px;
  color: #50dfff;
  text-decoration: none;
  font-weight: bold;
}

.project:hover {
  transform: translateY(-5px); /* nosto efekti */
}

/*--------------------------------CONTACT FORM-------------------------------------------------------*/

.form-wrap {
  min-height: 40vh; /* määrittelee korkeus, да покрива целия екран */
  background: hsl(235, 36%, 46%);
  display: flex;
  flex-direction: column;
  justify-content: center; /* центрира вертикално */
  align-items: center; /* центрира хоризонтално */
  padding: 20px;
  box-sizing: border-box;
  overflow: auto; /* sallii vierityksen, jos sisältö menee yli */
}
h2 {
  color: white;
}
form {
  flex-grow: 1; /* Заема останалото място */
  max-width: 500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

label {
  color: #f8f8fb;
  margin-top: 20px;
  margin-bottom: 5px;
  font-size: 16px;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 5px;
  border: none;
  margin-bottom: 10px;
  font-size: 16px;
}

textarea {
  resize: vertical; /* Позволява само вертикално разтягане */
  min-height: 150px;
}

button {
  margin-top: 20px;
  background: #50dfff;
  color: hsl(235, 36%, 46%);
  padding: 12px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #38c0da;
}

.attribution {
  margin-top: 30px;
  color: white;
  font-size: 0.9em;
}

.attribution a {
  color: aqua;
  text-decoration: none;
}

#toTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 90px;
  height: 45px;
  background-color: #50dfff;
  color: hsl(235, 36%, 46%);
  border: none;
  border-radius: 5px; /* Малко заобляне на ъглите */
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.3s, transform 0.3s;
  /* display: none;  <-- Махаме този ред! */
}

#toTopBtn:hover {
  background-color: #38c0da;
  transform: scale(1.1);
}

.social.content {
  display: flex;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto; /* Центрира целия блок по хоризонталата */
  align-items: flex-start;
  gap: 60px;
  margin-top: 40px;
}

.social-icons-left {
  width: 200px; /* Принуждава иконките да стоят вляво */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 60px;
  font-size: 2rem;
  margin-top: 40px;
}

.social-icons-left a {
  color: white;
  transition: color 0.3s ease;
}

.social-icons-left a:hover {
  color: #50dfff;
}

@media (max-width: 468px) {
  .social.content {
    flex-direction: column;
    align-items: center;
  }

  .social-icons-left {
    flex-direction: row;
    justify-content: center;
    width: auto;
    gap: 60px;
    font-size: 2rem;
    margin-top: 40px;
  }

  form {
    width: 90%;
  }

  @media (max-width: 600px) {
    .hero {
      height: auto;
      min-height: 70vh;
      padding: 40px 20px;
    }
  }
}
