/* Global  */

@font-face {
  font-family: 'Poppins';
  src: url('./fonts/Poppins-Regular.woff2') format('woff2'),
    url('./fonts/Poppins-Regular.woff') format('woff');
  font-weight: 500;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* Added for better box model handling */
}

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

/* NEW: Prevent background scroll when mobile menu is open */
body.no-scroll {
  overflow: hidden;
}

html {
  scroll-behavior: smooth;
}

p {
  color: rgb(85, 85, 85);
}

/* Transition */
a,
.btn {
  transition: all 300ms ease;
}

/* Desktop-nav */
nav,
.nav-links {
  display: flex;
}

nav {
  justify-content: space-around;
  align-items: center;
  height: 17vh;
}

.nav-links {
  gap: 2rem;
  list-style: none;
  font-size: 1.5rem;
}

a {
  color: black;
  text-decoration: none;
}

a:hover {
  color: grey;
  text-decoration: underline;
  text-underline-offset: 1rem;
  text-decoration-color: rgb(181, 181, 181);
}

.logo {
  font-size: 2rem;
}

.logo:hover {
  cursor: default;
}

/* Mobile nav */
#hamburger-nav {
  display: none;
}

.hamburger-menu {
  position: relative;
  display: inline-block;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 20px;
  width: 30px;
  cursor: pointer;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: black;
  transition: all 0.3s ease-in-out; /* Corrected transition timing */
}

.menu-links {
  position: absolute;
  top: 100%;
  right: 0; /* Corrected from right: 0% */
  background-color: white;
  width: fit-content;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out; /* Corrected transition timing */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); /* Added shadow for better visibility */
  border-radius: 8px; /* Optional: rounded corners */
  z-index: 100; /* Ensure menu is on top */
}

.menu-links a {
  display: block;
  padding: 10px 20px;
  text-align: center;
  font-size: 1.5rem;
  color: black;
  text-decoration: none;
  transition: all 0.3s ease-in-out; /* Corrected transition timing */
}

.menu-links li {
  list-style: none;
}

.menu-links.open {
  max-height: 300px;
}

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(8px, 6px); /* Adjusted transform */
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(8px, -6px); /* Adjusted transform */
}

/* Sections */
section {
  padding-top: 4vh;
  height: 96vh;
  margin: 0 10rem;
  box-sizing: border-box;
  min-height: fit-content;
}

.section-container {
  display: flex;
  gap: 4rem;
  height: 80%;
}

/* Profile */
#profile {
  display: flex;
  justify-content: center;
  align-items: center; /* Vertically align content */
  gap: 5rem;
  height: 80vh;
}

.section__pic-container {
  display: flex;
  height: 400px;
  width: 400px;
  margin: auto 0;
}

.section__text {
  align-self: center;
  text-align: center;
}

.section__text p {
  font-weight: 600;
}

.section__text__p1 {
  text-align: center;
}

.section__text__p2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.title {
  font-size: 3rem;
  text-align: center;
}

#socials-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 1rem;
}

/* ICONS */
.icon {
  cursor: pointer;
  height: 2rem;
}

/* Buttons */
.btn-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  font-weight: 600;
  transition: all 300ms ease;
  padding: 1rem;
  width: 8rem;
  border-radius: 2rem;
}

.btn-color-1,
.btn-color-2 {
  border: rgb(53, 53, 53) 0.1rem solid;
}

.btn-color-1:hover,
.btn-color-2:hover {
  cursor: pointer;
}

.btn-color-1,
.btn-color-2:hover {
  background: rgb(53, 53, 53);
  color: white;
}

.btn-color-1:hover {
  background: rgb(0, 0, 0);
}

.btn-color-2 {
  background: none;
}

.btn-color-2:hover {
  border: rgb(255, 255, 255) 0.1rem solid;
}

/* About */
#about {
  position: relative;
}

.about-containers {
  gap: 2rem;
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.about-details-container {
  justify-content: center;
  flex-direction: column;
}

.about-containers,
.about-details-container {
  display: flex;
}

.about-pic {
  border-radius: 2rem;
}

.arrow {
  position: absolute;
  right: -2.5rem;
  bottom: 2.5rem;
}

.details-container {
  padding: 1.5rem;
  flex: 1;
  background: white;
  border-radius: 2rem;
  border: rgb(53, 53, 53) 0.1rem solid;
  border-color: rgb(163, 163, 163);
  text-align: center;
}

/* Skills section */
#skills {
  position: relative;
}

.skills-sub-title {
  color: rgb(85, 85, 85);
  font-weight: 600;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

.skills-details-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

/* THIS IS THE MAJOR FIX: Using CSS Grid for a perfect, responsive layout */
.article-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 2rem;
  justify-content: space-around;
}

article {
  display: flex;
  flex-direction: column; /* Stack icon on top of text */
  align-items: center;    /* Horizontally center content */
  gap: 0.5rem;
  text-align: center;
  width: auto; /* Allow article to shrink/grow within grid cell */
}

article .icon {
  cursor: default;
  height: 2.5rem; /* Made icons a bit bigger */
}

article div {
  align-self: stretch;
}

.cert-list {
  list-style-type: square;
  padding-left: 20px; /* Added padding for better alignment */
}

/* Projects section */
#projects {
  position: relative;
}

.color-container {
  border-color: rgb(163, 163, 163);
  background: rgb(250, 250, 250);
}

.project-img {
  border-radius: 2rem;
  width: 90%;
  height: 90%;
}

.project-title {
  margin: 1rem;
  color: black;
}

.project-btn {
  color: black;
  border-color: rgb(163, 163, 163);
}

/* Contacts section */
#contact {
  display: flex;
  justify-content: center;
  flex-direction: column;
  height: 70vh;
}

.contact-info-upper-container {
  display: flex;
  justify-content: center;
  border-radius: 2rem;
  border: rgb(53, 53, 53) 0.1rem solid;
  border-color: rgb(163, 163, 163);
  background: rgb(250, 250, 250);
  margin: 2rem auto;
  padding: 0.5rem;
}

.contact-info-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem;
}

.contact-info-container p {
  font-size: larger;
}

.email-icon {
  height: 2.5rem;
}

/* Footer section */
footer {
  height: 26vh;
  margin: 0 1rem;
}

footer p {
  text-align: center;
}

/* Enhancing about-me */

.highlight {
  font-weight: 600; 
  color: #0056b3; 
  background-color: rgba(0, 123, 255, 0.07); 
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap; /* Prevents the highlight from breaking mid-word */
}

/* In style.css */
.cert-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* Space between icon and text */
  margin-bottom: 0.5rem; /* Space between list items */
  font-size: 1rem; /* Adjust font size if needed */
}

.cert-icon {
  height: 1.5rem; /* Control the size of the icon */
  width: 1.5rem;
}

/* Add hover effect to project cards and skill boxes */
.details-container, .color-container {
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.details-container:hover, .color-container:hover {
    transform: translateY(-5px); /* Lifts the card up slightly */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* Adds a soft shadow */
}

/* Cert list decoration */

/* In style.css, you can add this near your other .cert-list styles */

/* Remove default link styling */
.cert-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit; /* Use the parent text color */
  text-decoration: none; /* Remove the underline */
  transition: color 300ms ease;
}

/* Add a hover effect for visual feedback */
.cert-list li a:hover {
  color: #0056b3; /* Change color on hover */
  text-decoration: underline; /* Add underline on hover */
}