/* PAGE - BASIC STYLE */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column; /* Stack flex children vertically */
  scroll-behavior: auto;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
}

/* Media Query for Larger Screens */
@media (min-width: 769px) {
  body {
    font-size: 1.4rem; /* Retain original font size for larger screens */
  }
  header {
    background: rgba(0, 0, 0, 0.9);
  }
}

/* PAGE - BASIC STYLE - buttons*/
.btn,
.box-btn {
  display: inline-block;
  padding: 1% 2%; /* Changed to percentage for responsive padding */
  border: none;
  border-radius: 0.313rem;
  margin-top: 1.25rem;
  margin-left: 0.938rem;
  cursor: pointer;
  font-size: 1.2vw; /* Responsive font size */
}
.box-btn-dark,
.btn-dark {
  background: #222222;
  color: #fff;
  transition: background 0.3s ease; /* Optimized transition property */
}
.box-btn-dark:hover,
.btn-dark:hover {
  background: #444;
  border-radius: 0.313rem;
  transition: 0.3s ease all;
}

.backtothetopbtn {
  --offset: 3.125rem;
  position: fixed; /* Use fixed instead of sticky to keep it relative to the viewport */
  bottom: 0.7rem; /* Position from the bottom */
  right: 2.5rem; /* Position from the right */
  text-decoration: none;
  padding: 0.3rem;
  width: 5rem;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;

  color: #fff;
  background: black;
  border-radius: 0.313rem;
  white-space: nowrap;
  z-index: 1000; /* Ensure it's above other content */
  display: none;
}

/* General container */

.gen-container {
  flex: 1; /* Flex child allowed to grow and fill available space */
}

#page-main {
  flex: 1;
}

/* Apply blur effect */
.gen-container#blur.active {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

/* PAGE - BASIC STYLE - header styles */
header {
  background: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  padding: 1% 2%;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 900;
  display: flex;
  align-items: center;
}

.header-logo img {
  margin-right: 20px; /* Adjust spacing as needed */
  width: 4.375rem;
  height: 2.875rem;
}

.header-title h1 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.7;
  color: white;
  text-decoration: none;
  text-align: center;
}
.header-title a {
  text-decoration: none;
}
/* Use a more specific selector, or the important keyword as a last resort */
.header-title > a {
  text-decoration: none !important;
}

/* end of PAGE - BASIC STYLE */

/* Hamburger menu */
.hamburger {
  display: flex;
}

/* MAIN NAVIGATION */
header #main-navigation {
  width: 67%;
  display: inline-block;
  text-align: right;
}

header #main-navigation ul {
  list-style: none;
  display: flex;
  justify-content: flex-end;
}
header #main-navigation ul li {
  display: inline-block;
}
header #main-navigation ul li a {
  color: white;
  text-decoration: none;
  padding: 0.625rem 0.938rem;
}
header #main-navigation ul li a:hover {
  background: #444;
  border-radius: 0.188rem;
  transition: 0.3s ease all;
}
header #main-navigation a:active {
  text-decoration: underline;
}
header #main-navigation ul li a.active {
  text-decoration: underline;
  /* Add other styles for active state as needed */
}

/* end of MAIN NAVIGATION */

/*HERO*/
.hero {
  height: 100vh;
  padding-top: 0;
  text-align: center;
  background: #555;
  background-image: url(../img/background.jpg);
  background-size: cover;
  display: flex; /* Use flexbox to center content */
  align-items: flex-end; /* Aligns vertically */
  justify-content: center; /* Aligns horizontally */
}
.hero-content {
  color: black;
  line-height: 1.2;
  max-width: 960px;
  width: 100%;
}
.hero-title {
  margin-top: 0.5rem;
  margin-left: 4rem;
  font-size: 6vw;
  line-height: 0.6;
}
.hero-content p {
  font-size: 2.5vw;
  margin-bottom: 3rem;
  margin-left: 4rem;
}
.hero-content #slogan {
  font-size: 1.5vw;
  line-height: 4;
  margin-bottom: 0;
}
/* end of HERO */

/* SKILLS AND PROJECTS */
.site-section {
  padding: 2.6% 0; /* Pealkirjale peale mineva menüü asendi reguleerimine */
  background-color: #ededed;
}
.section-header {
  text-align: center;
  margin-bottom: -1rem;
}
.section-title {
  text-align: center;
  margin-bottom: 5px;
}
.section-header h2 {
  font-size: 1.9rem;
  letter-spacing: 0.125rem;
  text-transform: uppercase;
  font-weight: 18.75rem;
  color: #777;
}
.skills-section-title {
  text-align: center;
  margin-top: -20px;
  margin-bottom: 5px;
  font-size: 1.2rem;
  letter-spacing: 0.125rem;
  text-transform: uppercase;
  font-weight: 18.75rem;
  color: #777;
}
.projects-section-title {
  text-align: center;
  margin-top: -85px;
  margin-bottom: 5px;
  font-size: 1.2rem;
  letter-spacing: 0.125rem;
  text-transform: uppercase;
  font-weight: 18.75rem;
  color: #777;
}

.container-1 {
  height: 400px;
}
.container-2 {
  height: 400px;
}
.slider-container {
  max-width: 1150px;
  width: 100%;
  height: 300px;
}

.slider-content {
  margin: 0 40px;
  overflow: hidden;
  border-radius: 25px;
  background: white;
}

.card {
  position: relative; /* Add this line */
  border-radius: 25px;
  background-color: #fff;
  height: 270px; /* Adjust the height if needed to accommodate the button */
}

.image-content,
.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 14px;
}

.image-content {
  position: relative;
  row-gap: 5px;
  padding: 5px 0;
}

.overlay {
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: #222222;
  border-radius: 25px;
  top: 0;
  left: 0;
}

.card-image {
  position: relative;
  height: 75px;
  width: 75px;
  background-color: #fff;
  border-radius: 50%;
  padding: 3px;
}

.card-image img {
  z-index: 0;
  position: relative;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #777;
  right: 4px;
  bottom: 5px;
}

.name {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}
.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 14px;
  flex-grow: 1; /* Allow the description to take up the remaining space */
}

.description {
  font-size: 16px;
  font-weight: 400;
  color: #707070;
  text-align: center;
  margin-top: -5px;
  flex-grow: 1; /* Allow the description to take up the remaining space */
}

.rdmore-button {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 8px 16px;
  margin-top: 10px;
  background-color: #222222;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: flex-end; /* Push the button to the bottom */
}
a .rdmore-button:hover {
  background-color: #444;
}

.swiper-navBtn {
  color: #222222;
  transition: all 0.3s ease;
  margin-bottom: -20px;
}

.swiper-navBtn:hover {
  color: #444;
}

.swiper-navBtn::before,
.swiper-navBtn::after {
  font-size: 35px;
}

.swiper-button-next {
  right: 0;
}

.swiper-button-prev {
  left: 0;
}

.swiper-pagination-bullet {
  background-color: #222222;
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background-color: #444;
}

/* Popup styling */
#popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw; /* Use viewport units for responsive width */
  max-width: 500px;
  min-height: 200px;
  padding: 5vw; /* Use viewport units for responsive padding */
  background: white;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  border: solid black 1rem;
  border-radius: 2rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 9999;
  overflow: auto; /* Changed to 'auto' to accommodate varying content sizes */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#popup.active {
  visibility: visible;
  opacity: 1;
}
#popup h2 {
  margin-top: 0rem;
  font-size: 2rem;
}
#popup p {
  font-size: 1.7rem; /* Base font size for text */
  margin: 1rem 0; /* Add space between paragraphs */
  text-align: justify;
  word-wrap: break-word; /* Ensure long words do not overflow */
  line-height: 2.5rem;
}
.open-link-button {
  display: none; /* Initially hidden */
  justify-content: center;
  align-items: center;
  position: absolute;
  height: 1rem;
  bottom: 1rem;
  right: 8.7rem; /* Adjust this value so that it's to the left of the Close button */
  padding: 0;
  height: 40px;
  width: 80px;
  background: black;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  z-index: 9999;
  text-align: center;
}

/* Close button styling */
.close-button {
  display: flex; /* Use flexbox to align content */
  justify-content: center; /* Center content horizontally */
  align-items: center;
  position: absolute;
  height: 1rem;
  bottom: 1rem; /* adjust as needed */
  right: 1rem;
  padding: 0; /* Remove padding if using flexbox */
  height: 40px; /* Specify a height for the button */
  width: 7.2rem; /* Increase padding for a larger clickable area */
  background: black;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  z-index: 9999;
  text-align: center;
}
.open-link-button:hover,
.close-button:hover {
  background: #444;
  border-radius: 0.313rem;
  transition: 0.3s ease all;
}
.hidden-content {
  display: none;
}
.hidden-content #htmlcss-content {
  color: black;
  text-align: justify;
  line-height: 4rem;
}

/* end of SKILLS AND PROJECTS */

/* ABOUT */
.about {
  position: relative;
  background-color: #ededed;
  width: 100%;
  padding: 3.125rem 0rem 2.188rem;
  margin-bottom: 0rem;
  overflow: hidden;
}
.about img {
  float: right;
  width: 40%;
  border-radius: 25%;
  margin-left: 6.875rem;
  margin-right: 5rem;
  margin-bottom: 1.875rem;
}
.about p {
  margin-left: 6%;
  text-align: left;
  font-size: 1.4rem;
  width: 80%;
}
.about-buttons {
  position: absolute;
  bottom: 6.5rem; /* Adjust as needed */
  left: 24%; /* Start at the center */
  font-size: 1.2rem;
  padding: 8px 16px;
  background: black;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateX(-50%); /* Center the button relative to the `.about` */
}
#cvbutton {
  width: 4rem;
  overflow: hidden;
}
#coursesbutton {
  width: 7rem;
  margin-left: 7rem;
}
/* end of ABOUT */

/* CONTACT */
#contact {
  margin-top: 0rem;
  text-align: left;
  background-image: url(../img/contact-background.jpg);
  background-size: cover;
  padding: 1rem 0;
}
#contact .contact-section-header h2 {
  font-size: 1.9rem;
  letter-spacing: 0.125rem;
  text-transform: uppercase;
  font-weight: 18.75rem;
  color: #777;
  text-align: center;
  margin-top: 3.7rem;
}
.contact-section-title h3 {
  font-size: 1.4rem;
  letter-spacing: 0.125rem;
  text-transform: uppercase;
  font-weight: 18.75rem;
  color: #777;
  margin-top: -1rem;
  text-align: left;
}
#contact .contact-form {
  max-width: 70%; /* Changed for better responsiveness */
  margin: auto;
  padding: 1rem;
  box-sizing: border-box;
}
#contact .contact-form .form-group {
  margin: 0.75rem 0rem;
  margin-bottom: 0;
  max-width: 70%;
  width: 30rem;
}
#contact .contact-form .form-group label {
  display: block;
  padding-top: 0.938rem;
  width: 18.75rem;
}

#contact .contact-form .form-group input {
  width: 100%;
  border: 0.125rem solid black;
  padding: 0.5rem;
}
#contact .contact-form #submit {
  width: 8rem;
  height: 3rem;
  margin-bottom: 0rem;
  margin-left: 5%;
  font-size: 1.2rem;
  text-align: center;
  padding: 8px 16px;
  background: black;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateX(-50%); /* Center the button relative to the `.about` */
}
#contact .contact-form #submit:hover {
  background: #444;
  border-radius: 0.313rem;
  transition: 0.3s ease all;
}

#contact .contact-form .form-group textarea {
  width: 100%;
  height: 9.375rem;
  padding: 0.5rem;
  border: 0.125rem solid black;
}
#contact .contact-form .form-group input:focus,
#contact .contact-form .form-group textarea:focus {
  outline: none;
  border: #333 solid 0.063rem;
}
/* end of CONTACT */

/* FOOTER */
/* FOOTER */
footer {
  margin-top: auto; /* This will push the footer to the bottom */
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: black;
  color: white;
  padding: 1rem;
  text-align: center;
  height: 69px;
}

footer p {
  color: white;
  margin: 0rem;
}
.social-links {
  display: flex;
  justify-content: center; /* This will center the links horizontally */
  align-items: center; /* This will center them vertically */
  flex-wrap: wrap; /* This allows the items to wrap in case of small screen size */
  gap: 0.5rem; /* This adds space between the items */
}
.social-links a,
.social-links div {
  margin: 0rem 0; /* Add some vertical space between links */
}
.social-links img {
  width: 1rem;
  height: 1rem;
  padding: 0rem 0.625rem;
}
.footer-text {
  margin-top: 0.7rem; /* Add space between icons and text */
  text-align: center;
}
footer .social-links,
footer .footer-text {
  width: 100%; /* Ensure full width */
  margin-bottom: 0.1rem; /* Space between social links and text */
}

footer .footer-text p {
  text-align: center !important;
}
.social-links img {
  width: 2rem;
  height: 2rem;
  object-fit: contain; /* This prevents images from stretching */
}

/* end of FOOTER */

@media only screen and (max-width: 1320px) {
  header {
    padding: 10 50px;
    background: rgba(0, 0, 0, 0.9);
  }
}
@media only screen and (max-width: 1100px) {
  header {
    padding: 10px 50px;
    background: rgba(0, 0, 0, 0.9);
    margin-bottom: 15px;
  }
  header #main-navigation {
    /* ... other styles ... */
    top: 3px; /* Adjust this to match the actual height of your header */
  }
}
@media only screen and (max-width: 900px) {
  header {
    position: fixed; /* Keep the header fixed at the top */
    width: 100%; /* Full width */
    top: 0; /* Stick to the top */
    z-index: 1001; /* Higher than the navigation z-index to stay on top */
    background: rgba(0, 0, 0, 0.9);
  }
  .hamburger {
    display: block;
    cursor: pointer;
    margin-left: 10px;
  }
  .hamburger .line {
    width: 30px;
    height: 3px;
    background: #fefefe;
    margin: 6px 0;
  }
  header #main-navigation {
    position: fixed; /* Fixed position to stay in place while scrolling */
    width: 100%;
    top: 74.5px; /* Start below the header */
    left: 0; /* Align to the left */
    right: 0; /* Align to the right */
    bottom: 0; /* Extend to the bottom of the screen */
    background: rgba(0, 0, 0, 0.9); /* Semi-transparent black background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.5s;
    visibility: hidden; /* Hide by default */
    opacity: 0; /* Fully transparent by default */
    z-index: 1000; /* Ensure it's below the header */
  }

  /* ... */

  header #main-navigation.active {
    visibility: visible; /* Make it visible when active */
    opacity: 1; /* Fully opaque when active */
    /* No need to set max-height or height here */
  }

  header #main-navigation ul {
    margin: 0; /* Remove default margin */
    padding: 0; /* Remove default padding */
    list-style: none; /* No bullet points */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto; /* Auto width based on content */
  }

  header #main-navigation ul li a {
    color: white;
    text-decoration: none;
    padding: 15px; /* Larger padding for tap targets */
    font-size: 1.5rem; /* Larger font size for better readability on small screens */
    display: block; /* Make the links take up the full width of their container */
    text-align: center; /* Center the text within the links */
  }
  .hero-title {
    font-size: 3.5rem;
  }
  .hero-content p {
    font-size: 2.5rem;
  }
  .hero-content #slogan {
    font-size: 1.5rem;
  }
  .hero-title,
  .hero-content p,
  .hero-content #slogan {
    margin-left: 210px;
    margin-bottom: 0px;
    padding: 5px;
  }
}
@media (max-width: 768px) {
  header {
    background: rgba(0, 0, 0, 0.9);
  }
  /* or any other breakpoint that suits your design */
  #main-navigation ul {
    /* Change to vertical stack for smaller screens */
    flex-direction: column;
    align-items: flex-start; /* Align items to the start of the flex container */
  }

  #main-navigation ul li {
    /* Ensure list items take up the full width of the ul on smaller screens */
    width: 100%;
    text-align: left; /* Align text to the left */
    text-align: center;
    line-height: 2.4rem;
  }
  /* other styles... */
  .backtothetopbtn {
    margin-left: auto; /* Reset the margin for smaller screens */
    margin-right: auto; /* Reset the margin for smaller screens */
    right: 1.25rem; /* Adjust the right positioning for smaller screens */
  }
  header,
  footer,
  .contact-section,
  .main-content {
    padding: 10px; /* smaller padding */
  }
  .hero-title,
  .hero-content p {
    font-size: 5vw; /* Increased font size for smaller screens */
    margin-left: 140px;
    margin-top: 40px;
  }

  .hero-content #slogan {
    display: none;
  }
  .slider-content {
    margin: 0 10px;
  }

  .swiper-navBtn {
    display: none;
  }
  .btn,
  .btn-dark {
    padding: 10px 15px; /* Adjust padding for smaller screens */
    margin: 10px 0; /* Add some margin to the top and bottom */
  }
  #popup {
    width: 70vw; /* Increase width for smaller screens */
    padding: 10vw; /* Increase padding for smaller screens */
    margin-top: 5rem;
  }

  #popup h2 {
    font-size: 1.5rem; /* Adjust heading size for smaller screens */
  }

  #popup p {
    font-size: 0.8rem; /* Adjust paragraph size for smaller screens */
  }
  .open-link-button {
    bottom: 0.5rem;
    right: 6.8rem; /* Adjust this value so that it's to the left of the Close button */
    height: 30px;
    width: 80px;
    font-size: 0.8rem;
  }

  .close-button {
    height: 30px; /* Smaller height for the button */
    width: 6rem; /* Smaller width for the button */
    font-size: 0.8rem; /* Smaller font-size for the text */
    bottom: 0.5rem; /* Closer to the bottom edge */
    right: 0.5rem; /* Closer to the right edge */
    /* Adjust padding if needed, but with flexbox it may not be necessary */
  }

  .about-buttons {
    /* Adjust positioning for smaller screens */
    left: 38%;
    transform: translateX(-50%);
    bottom: 0.1rem; /* You may need to adjust this value */
  }

  #contact .contact-form .form-group input,
  #contact .contact-form .form-group textarea {
    width: 100%; /* Make input fields take full width */
    margin: 0; /* Reset margins */
    padding: 0.5rem; /* Consistent padding */
    box-sizing: border-box;
  }

  #contact .contact-form #submit {
    width: auto; /* Allow button to adjust its width */
    padding: 10px 15px; /* Comfortable padding */
    font-size: 1rem; /* Readable font size */
    margin-top: 1rem; /* Space above the button */
    margin-left: 13%;
  }
  footer {
    margin-bottom: 0; /* Adjust this value to position the footer higher on the page */
  }
}
