/* GENERAL */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

/* CSS Variables for theming */
:root {
  --bg-color: white;
  --text-color: black;
  --text-color-2: rgb(85, 85, 85);
  --border-color: rgb(163, 163, 163);
  --container-bg: rgb(250, 250, 250);
  --btn-color-1: black;
  --btn-color-2: rgb(53, 53, 53);
}

body.dark-theme {
  --bg-color: rgb(33, 37, 41);
  --text-color: white;
  --text-color-2: rgb(200, 200, 200);
  --border-color: rgb(100, 100, 100);
  --container-bg: rgb(45, 52, 58);
  --btn-color-1: white;
  --btn-color-2: rgb(220, 220, 220);
}

* {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

p {
  color: var(--text-color-2);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
}

/* TRANSITION */

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

/* Elements that change with theme */
nav,
.details-container,
.color-container,
.contact-info-upper-container,
.hamburger-icon span,
.menu-links {
  transition: all 0.3s ease;
}

/* DESKTOP NAV */

nav,
.nav-links {
  display: flex;
}

nav {
  justify-content: space-between;
  align-items: center;
  height: 17vh;
  padding: 0 2rem;
  background-color: var(--bg-color);
}

#desktop-nav > div {
  display: flex;
  align-items: center;
  gap: 2rem;
}

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

a {
  color: var(--text-color);
  text-decoration: none;
  text-decoration-color: white;
}

a:hover {
  color: grey;
}

/* THEME TOGGLE */

.theme-toggle-btn {
  background: none;
  border: 2px solid var(--text-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: 1rem;
}

.theme-toggle-btn:hover {
  /* Remove background color change, keep only border */
  border-color: var(--text-color);
}

.theme-toggle-btn.mobile {
  margin: 0.5rem 0;
  align-self: center;
}

.theme-icon {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease;
}

/* Make sun icon smaller when in light mode */
.theme-icon[src*="sun.png"] {
  width: 24px;
  height: 24px;
}

.theme-toggle-btn:hover .theme-icon {
  transform: scale(1.2);
}

.logo {
  font-size: 2rem;
}

.logo:hover {
  cursor: default;
}

/* HAMBURGER MENU */

#hamburger-nav {
  display: none;
}

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

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

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  transition: all 0.3s ease-in-out;
}

.menu-links {
  position: absolute;
  top: calc(100% + 1rem); /* Add space between hamburger and menu */
  right: 0;
  background-color: var(--bg-color);
  width: fit-content;
  min-width: 200px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  padding: 0;
  z-index: 9999; /* Ensure menu appears on top */
}

.menu-links a {
  display: block;
  padding: 15px 20px;
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.menu-links a:hover {
  background-color: var(--container-bg);
}

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

.menu-links.open {
  max-height: 400px;
  padding: 10px 0;
  opacity: 1;
  visibility: visible;
}

/* Center the theme toggle button in mobile menu */
.menu-links .theme-toggle-btn.mobile {
  margin: 10px auto;
  display: block;
}

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(10px, 5px);
}

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

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(10px, -5px);
}

/* Reset hamburger icon when closed */
.hamburger-icon:not(.open) span {
  transform: none;
  opacity: 1;
}

/* SECTIONS */

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

.section-container {
  display: flex;
}

/* PROFILE SECTION */

#profile {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 5rem;
  height: 80vh;
}

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

/* Profile section specific styling */
#profile .section__pic-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.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;
  color: var(--text-color);
}

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

#socials-container .icon {
  transition: all 0.3s ease;
}

#socials-container .icon:hover {
  transform: scale(1.2);
  filter: brightness(1.2);
}

/* ICONS */

.icon {
  cursor: pointer;
  height: 2rem;
}

/* Make icons light in dark mode */
body.dark-theme .icon:not(.theme-icon) {
  filter: invert(1) brightness(1.2);
}

/* Keep social icons and arrows with their original styling but make them lighter */
body.dark-theme #socials-container .icon,
body.dark-theme .arrow {
  filter: invert(1) brightness(1.5);
}

/* 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: var(--btn-color-2) 0.1rem solid;
}

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

.btn-color-1,
.btn-color-2:hover {
  background: var(--btn-color-2);
  color: var(--bg-color);
}

.btn-color-1:hover {
  background: var(--btn-color-1);
}

.btn-color-2 {
  background: none;
  color: var(--btn-color-2);
}

.btn-color-2:hover {
  border: var(--bg-color) 0.1rem solid;
}

.btn-container {
  gap: 1rem;
}

/* ABOUT SECTION */

#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: -5rem;
  bottom: 2.5rem;
  transition: all 0.3s ease;
}

.arrow:hover {
  transform: translateY(-5px) scale(1.1);
  filter: brightness(1.3);
}

.arrow-up {
  position: absolute;
  right: -5rem;
  bottom: 5rem;
  transition: all 0.3s ease;
  transform: rotate(180deg);
}

.arrow-up:hover {
  transform: rotate(180deg) translateY(-5px) scale(1.1);
  filter: brightness(1.3);
}

/* When both arrows are present, stack them vertically */
.arrow-up + .arrow {
  bottom: 2.5rem;
}

.details-container {
  padding: 1.5rem;
  flex: 1;
  background: var(--container-bg);
  border-radius: 2rem;
  border: var(--border-color) 0.1rem solid;
  text-align: center;
}

/* Make tech stack container smaller */
#experience .details-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.2rem;
}

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

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

.about-text{
  margin: 1rem;
  color: var(--text-color-2);
}

/* EXPERIENCE SECTION */

#experience {
  position: relative;
}

.experience-sub-title {
  color: var(--text-color-2);
  font-weight: 600;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.experience-details-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
  margin-bottom: 3rem;
}

.article-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.2rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  text-align: initial;
}

article {
  display: flex;
  width: 100%;
  max-width: 160px;
  justify-content: flex-start;
  gap: 0.7rem;
  align-items: center;
}

article .icon {
  cursor: default;
}

/* CERTIFICATION STYLES */

.certification-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.certification-link {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
}

.certification-link:hover {
  text-decoration: none;
}

.certification-article {
  display: flex;
  width: 100%;
  max-width: none;
  justify-content: flex-start;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 1rem;
  background: var(--container-bg);
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.certification-article:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: var(--text-color);
  background: var(--bg-color);
}

.certification-article h3 {
  color: var(--text-color);
  font-weight: 600;
  margin: 0;
}

.certification-description {
  font-style: italic;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color-2);
}

/* PROJECTS SECTION */

#projects {
  position: relative;
}

#projects .experience-details-container {
  margin-top: 3rem;
}

/* Projects responsive grid layout */
#projects .about-containers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem 3rem; /* row gap, column gap */
  max-width: 1200px;
  margin: 3rem auto 0; /* Added top margin for spacing */
  padding: 0 2rem;
}

#projects .details-container {
  width: 100%;
  margin: 0;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.color-container {
  border-color: var(--border-color);
  background: var(--container-bg);
}

.project-img {
  border-radius: 2rem;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-title {
  margin: 1rem;
  color: var(--text-color);
}

.project-btn {
  color: var(--text-color);
  border-color: var(--border-color);
}

/* CONTACT */

#contact {
  position: relative;
  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: (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;
}

.contact-icon {
  cursor: default;
}

.email-icon {
  height: 2.5rem;
}

/* FOOTER SECTION */

footer {
  height: 26vh;
  margin: 0 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

footer nav {
  margin-bottom: 1rem;
}

footer .nav-links-container {
  display: flex;
  justify-content: center;
}

footer .nav-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 0;
}

/* Hide arrows on mobile */
@media (max-width: 900px) {
  .arrow,
  .arrow-up,
  .arrow-label {
    display: none !important;
  }
}
