* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style-type: none;
  text-decoration: none;
}

body {
  font-family: 'Inter', sans-serif;
}

:root {
  --main_title_color: white;
  --main_title_size: clamp(3.5rem, 8vw, 4.5rem);
  --h3_font_size: 2.5rem;
  --h3_font_color: #003049;
  --h4_font_size: clamp(1.5rem, 8vw, 2rem);
  --h4_font_color: white;
  --h5_font_size: clamp(1.25rem, 4vw, 1.5rem);
  --tags_font_size: 0.9rem;
  --tags_font_color: white;
  --regular_text_font_size: clamp(1rem, 3vw, 1.25rem);
  --regular_text_font_color: white;
  --button_font_size: 1.06rem;
  --button_font_color: white;
  --list_item_font_size: 1.38rem;
  --list_item_font_color: white;
  --rubik_font_style: 'Rubik', sans-serif;
}

/* Basic text styling */
.text_styles h1 {
  font-size: var(--main_title_size);
  color: var(--main_title_color);
  font-family: var(--rubik_font_style);
  margin-bottom: 2rem;
}

.text_styles h3 {
  font-size: var(--h3_font_size);
  color: var(--h3_font_color);
  font-family: var(--rubik_font_style);
}

.text_styles h4 {
  font-size: var(--h4_font_size);
  color: var(--h4_font_color);
  font-weight: normal;
}

.text_styles h5 {
  font-size: var(--h5_font_size);
  color: white;
  font-weight: normal;
}

.text_styles p {
  font-size: var(--regular_text_font_size);
  color: var(--regular_text_font_color);
}

.text_styles ul li {
  font-size: var(--list_item_font_size);
  color: var(--list_item_font_color);
}

.text_styles a {
  font-size: var(--button_font_size);
  color: var(--button_font_color);
}

/* Web page Header CSS Styles */

.nav-bar {
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: center;
  background-color: #022435;
  padding: 0 2rem;
  z-index: 1;
}

.nav_title {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 1rem;
}

.nav_title * {
  color: white;
  display: block;
}

.nav_title.active {
  display: none;
}

.nav_title:hover {
  transform: translateY(-5px);
  transition: transform 0.3s;
  transition-timing-function: ease-out;
}

#mail-icon {
  margin-left: 1rem;
}

.nav-item a:hover #mail-icon {
  transition: transform 1s;
  transition-timing-function: ease-in-out;
  transform: rotate(360deg);
}

.nav-menu {
  display: none;
  flex-direction: column;
  padding: 0;
  width: 80%;
  height: 100vh;
  margin: 3rem auto;
  text-align: left;
}

.nav-menu.active {
  display: flex;
}

.nav-item {
  list-style: none;
}

.nav-item a {
  font-size: 1.5rem;
  font-weight: bold;
  display: block;
  color: white;
  padding: 1.5rem;
}

.nav-item a:hover {
  background-color: #003a57;
  transform: translateY(-5px);
  transition: transform 0.3s;
  transition-timing-function: ease-out;
  box-shadow: 0 0.5em 0.5em -0.4em #26aa5b;
}

.toggle-button {
  position: absolute;
  right: 2rem;
  top: 1rem;
  height: 2rem;
}

.close-button {
  position: absolute;
  display: none;
  right: 2rem;
  top: 1rem;
  height: 2rem;
}

.hide {
  display: none;
}

.show {
  display: flex;
}

.toggle-button:hover {
  transform: translateY(-5px);
  transition: transform 0.3s;
  transition-timing-function: ease-out;
}

/**** Media Query ****/
@media (min-width: 768px) {
  .nav-menu {
    display: flex;
    flex-direction: row;
    height: fit-content;
    width: auto;
    margin: 0;
  }

  .nav-menu .nav-item {
    text-align: center;
    border-bottom: none;
  }

  .nav-item a {
    font-size: 1rem;
    font-weight: normal;
  }

  .toggle-button {
    display: none;
  }

  .close-button {
    display: none;
  }
}

/****** Hero Section ********/

.background {
  background-color: #003049;
  background-image: url("../images/Main_Background.svg");
  background-size: cover;
  background-repeat: no-repeat;
  height: fit-content;
  overflow: hidden;
  position: relative;
}

.main-section {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: space-between;
  padding: 6rem 1rem;
  position: relative;
}

.Intro {
  display: flex;
  flex-direction: column;
}

#Social_Media_Icons {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 3rem;
  order: 2;
  margin-top: 1rem;
}

#Social_Media_Icons a {
  width: 20px;
}

#hero_image {
  position: absolute;
  left: 60%;
  width: 50%;
}

#down-arrow {
  animation: bounce 1.65s infinite;
  position: absolute;
  top: 80%;
  left: 50%;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-20px);
  }

  60% {
    transform: translateY(-10px);
  }
}

@media (min-width: 768px) {
  .main-section {
    grid-template-columns: 1fr 1fr;
  }

  .Intro {
    flex-direction: row;
    align-items: center;
  }

  #hero_image {
    position: initial;
    width: 100%;
  }

  #Social_Media_Icons {
    display: flex;
    flex-direction: column;
    order: 0;
    margin-right: 3rem;
    justify-content: space-around;
  }
}

/* --- NEW SKILLS SECTION STYLES --- */
#Skills {
  padding: 4rem 1rem;
  background-color: #fbf8f7;
}

.skills_title {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
  text-align: center;
}

.section_line {
  display: block;
  width: 100%;
  border-bottom: solid 2px #091e42;
  margin: 1rem auto;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive Grid */
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.skill-info h4 {
  color: #003049;
  margin-bottom: 0.5rem;
}

.skill-card {
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.3s ease;
}

.stars {
  display: flex;
  gap: 5px;
}

.star {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-color: #ccc;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/></svg>') no-repeat center;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/></svg>') no-repeat center;
}

.star.filled {
  background-color: #f55800;
}

@media (min-width: 768px) {
  #Skills {
    padding: 6rem 4rem;
  }
}

/* PROJECTS SECTION - GRID LAYOUT */
.my_work {
  padding: 4rem 1rem;
}

.works_title {
  display: flex;
  flex-direction: column;
  margin-bottom: 3.25rem;
  text-align: center;
}

#top_line {
  display: block;
  width: 100%;
  border-bottom: solid 2px #091e42;
  margin: 4rem auto;
}

#projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(327px, 1fr));
  grid-gap: 2rem;
}

.project-card {
  /* Keep existing styles, but ensure transition is set */
  background: white; /* Changed from gradient to white for cleaner look */
  border-radius: 1.25rem;
  overflow: hidden; /* Keeps image inside corners */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy pop */
  height: auto; /* Let content define height */
  padding-bottom: 2rem;
  position: relative;
}

.project_img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  opacity: 1; /* Full opacity now */
  border-bottom: 1px solid #eee;
}

.project-card h4 {
  color: #003049;
  padding: 1rem;
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
}

/* Button positioning in card */
.project-button {
  background-color: #06a646;
  color: #fbf8f7;
  font-size: var(--button_font_size);
  padding: 0.75rem;
  font-weight: bold;
  display: block;
  border-radius: 5%;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  margin: 0 auto;
  width: 60%;
  bottom: auto;
}

.project-button:hover {
  box-shadow: 0 0.5em 0.5em -0.4em #06a646;
  transform: translateY(-0.2em);
  cursor: pointer;
}

.modal {
  padding: 1em;
  margin: auto;
  border: none;
  box-shadow: 0 0 1em rgb(0 0 0 / 0.3);
  border-radius: 1rem;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
}

.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content p {
  color: #091e42;
  margin-bottom: 2rem;
}

#modalImage {
  max-width: 100%;
  margin: 0.5rem 0;
}

.btn_container {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  justify-content: left;
}

.btn_container .project-button {
  color: #fbf8f7;
  font-size: 1rem;
}

@media (min-width: 768px) {
  .my_work {
    padding: 6rem 4rem;
  }

  .works_title {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    text-align: left;
  }

  #top_line {
    width: 62%;
    margin: 0;
  }
}

.project-card:hover {
  background-image: linear-gradient(to right bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

#closeModal {
  width: 2rem;
  position: absolute;
  top: 2%;
  right: 2%;
}

#closeModal:hover {
  cursor: pointer;
}

@media (min-width: 768px) {
  .modal-content {
    display: flex;
    flex-direction: row;
  }

  .container.details {
    margin: 4.5rem 0 0 1rem;
  }
}

/* ABOUT SECTION */
#About {
  background: linear-gradient(90deg, rgba(0, 48, 73, 1) 0%, rgba(0, 68, 103, 1) 35%, rgba(2, 26, 38, 1) 100%);
  padding: 4rem 1rem;
  height: auto; /* Removed fit-content/overflow constraints if they were causing issues */
  overflow: hidden; /* Ensure no overflow issues */
}

.about_text {
  width: 100%;
}

#resume_button {
  margin-top: 2rem;
  position: absolute;
}

#about_image {
  margin-left: 50%;
  width: 70vw;
}

.line {
  display: block;
  width: 100%;
  margin: 8rem 0;
  border-bottom: solid 2px white;
}

@media (min-width: 768px) {
  #About {
    padding: 6rem 4rem;
  }

  .about_container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

  .about_text {
    width: 50%;
  }

  #about_image {
    margin-left: 0;
    width: 35vw;
  }

  #skills {
    flex-direction: row;
    align-content: center;
    text-align: center;
    margin-top: 8rem;
  }

  #skills li {
    text-align: left;
  }
}

/* CONTACT ME SECTION */

.contact_container {
  padding: 4rem 1rem;
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 2rem;
  height: fit-content;
}

.contact_container h3 {
  text-align: center;
  margin-top: 6rem;
}

#contact_form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 3rem;
}

#contact_form * {
  font-size: 1rem;
  border: none;
  border-bottom: solid 1px #979493;
  padding: 1rem;
}

#contact_form input:hover {
  box-shadow: 0 0.9em 0.8em -0.4em #06a646;
}

#text_box {
  border: none;
  background-color: #fbf8f7;
  height: 200px;
}

#contact_button {
  background-color: #f55800;
  padding: 0.75rem;
  font-weight: bold;
  display: block;
  width: fit-content;
  border-style: none;
  margin-inline: auto;
  font-size: var(--button_font_size);
  color: var(--button_font_color);
  border-radius: 5%;
  transition: transform 0.2s, box-shadow 0.2s;
}

#contact_button:hover {
  background-color: rgba(255, 255, 255, 0);
  color: #f55800;
  border: 2px solid #f55800;
  box-shadow: 0 0.5em 0.5em -0.4em #f55800;
  transform: translateY(-0.2em);
  cursor: pointer;
}

.btnsGroup {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  border-bottom: none;
}

.btnsGroup button {
  color: white;
}

@media (min-width: 768px) {
  .contact_container {
    grid-template-columns: repeat(2, 1fr);
    padding: 4rem 4rem;
  }

  .contact_container h3 {
    text-align: left;
  }

  #contact_button {
    margin-inline: 0;
  }
}

#footer_icons {
  color: #1c1a19;
  text-align: center;
  margin: 1rem 0;
}

#footer_icons a {
  margin-right: 1rem;
}
