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

body {
  font-family: "Red Hat Text", serif;
  text-align: center;
  font-weight: 300;
  font-style: normal;
  background-color: #f4f4f4;
  margin: 0;
  padding: 0;
}

h2 {
  font-size: 36px;
  margin-bottom: 10px;
}

/*Header*/
.navbar {
  max-width: 1200px;
  margin: auto;
  padding: 10px 18px 10px 18px;
  display: flex;
  list-style-type: none;
  align-items: center;
  justify-items: center;
  justify-content: space-between;
}

.logo {
  text-decoration: none;
  color: #333;
  font-size: 2rem;
  text-align: left;
}

.social,
.menu {
  display: flex;
  justify-content: end;
  gap: 10px 10px;
}

.menu a:hover {
  color: cornflowerblue;
}

.menu a.active {
  color: darkred;
}

.menu a {
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  transition: 0.2s ease-in-out;
}

/*Main*/
.container {
  max-width: 1200px;
  min-height: 776px;
  margin: auto;
  padding: 18px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/*About*/
.about {
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: 30% 30% 30%;
  min-height: 750px;
  background-image: url('/img/about-bg.webp');
  background-position: center;
  background-repeat: no-repeat;
  position: relative; /* Position relative to control layering */
}

.about::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Dark transparent veil */
  z-index: 0; /* Ensures it stays behind text */
}

.skills,
.software,
.education {
  z-index: 1;
  margin-right: 30px;
}

.skills h2,
.software h2,
.education h2 {
text-decoration: underline;
color: lightseagreen;
}

.skills ul,
.software ul,
.education ul{
  color: #ffffff;
  line-height: 2;
  list-style-type: none;
}

.container section {
  margin-top: 2rem;
  text-align: right;
}

.container iframe {
  width: 100%;
  border: none;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.buttons button {
  background: #ddd;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 50px;
  font-size: 16px;
  transition: 0.3s;
}

.buttons button:hover {
  background: lightskyblue;
  color: white;
}

.buttons button.active {
  background: lightcoral;
  color: white;
}

.category-content {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.category-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Grid for Cards */
.cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 10px;
  margin-top: 20px;
}

.card {
  display: flex;
  background: #ffffff;
  position: relative;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out;
  animation: fadeInCards 0.3s ease-in forwards;
  text-transform: uppercase;
}

/* Keyframes for fading in each card */
@keyframes fadeInCards {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.card img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 6px;
}

.card:hover {
  transform: translateY(-5px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.8) 90%
  );
  pointer-events: none; /* Ensures it doesn’t block interactions */
}

.card h3 {
  width: 90%;
  color: #ffffff;
  font-size: 18px;
  position: absolute;
  top: 20%;
  left: 5%;
}

.view-btn {
  color: #ffffff;
  background: none;
  border: #ddd;
  border-style: solid;
  border-width: 2px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 25px;
  font-size: 16px;
  transition: 0.3s;
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.view-btn:hover {
  background: cornflowerblue;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.pagination button {
  background: lightseagreen;
  color: white;
  border: none;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 25px;
  font-size: 16px;
  transition: 0.3s;
}

.pagination button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#pageInfo {
  font-size: 18px;
  font-weight: bold;
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  position: relative;
  background: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 90%;
  max-height: 90vh;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.lightbox img {
  width: 100%;
  max-width: 900px;
  margin: auto;
  height: auto;
  border-radius: 8px;
}

.lightbox-video {
  margin: auto;
  height: auto;
  border-radius: 8px;
}

.lightbox-content iframe {
  max-width: 75%;
  margin: 0 auto;
}

/* Style extra images */
#lightbox-extra-content img {
  width: 100%;
  height: auto;
  margin: 10px auto;
  border-radius: 8px;
}

/* Style extra text */
#lightbox-extra-content p {
  display: flex;
  justify-content: center;
  font-size: 16px;
  color: #333;
  margin-top: 10px;
  width: 90%;
  max-width: 800px;
  text-align: justify;
  margin: 20px auto 20px;
  line-height: 2;
}

/* The Visit Website Button */
#lightbox-extra-content a {
  display: flex;
  margin: auto;
  width: 150px;
  background: lightseagreen;
  color: white;
  border: none;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 25px;
  font-size: 16px;
  transition: 0.3s;
  justify-content: center;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 25px;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  color: #333;
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: #ffffff;
}

/* FORM */

/** FORM Variables **/

:root {
  --color-background: #cbd5e1;
  --color-background-alt: #64748b;
  --color-border-active: #64748b;
  --color-border-default: #94a3b8;
  --color-highlight: #cbd5e1;
  --color-primary: #1e293b;
  --color-primary-active: #090f1d;
  --color-text-default: #0f172a;
  --color-text-muted: #475569;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

[type="checkbox"],
[type="radio"],
[type="range"] {
  appearance: none;
  flex-shrink: 0;
  padding: 0;
  user-select: none;
}

[type="checkbox"]:focus,
[type="radio"]:focus,
[type="range"]:focus {
  outline: none;
}

/** Form Components **/

form {
  max-width: 600px;
  margin: auto;
}

.fs-form {
  display: grid;
  row-gap: 1.5rem;
}

.fs-form:where(.fs-layout__2-column) {
  column-gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
}

fieldset {
  display: grid;
  row-gap: 1.5rem;
}

.fs-form:where(.fs-layout__2-column) fieldset {
  column-gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
  grid-column: 1 / -1;
}

.fs-field {
  display: flex;
  flex-direction: column;
  row-gap: 0.375rem;
}

.fs-label {
  color: var(--color-text-default);
  display: block;
  font-family: var(--font-family-display);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

.fs-description {
  color: var(--color-text-muted);
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.fs-button-group {
  display: flex;
  flex-direction: row-reverse;
  column-gap: 1.5rem;
}

.fs-form:where(.fs-layout__2-column) .fs-button-group {
  grid-column: 1 / -1;
}

.fs-button {
  background-color: var(--color-primary);
  border-radius: 0.375rem;
  color: var(--color-background);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1rem;
  padding: 1rem 2rem;
  transition-duration: 200ms;
  transition-property: background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.fs-button:hover {
  background-color: var(--color-primary-active);
}

.fs-button:focus-visible {
  background-color: var(--color-primary-active);
  outline: 3px solid var(--color-highlight);
}

.fs-input,
.fs-select {
  appearance: none;
  border-radius: 0.375rem;
  border-width: 0;
  box-shadow: var(--color-border-default) 0 0 0 1px inset;
  color: var(--color-primary);
  font-size: 1rem;
  height: 2.5rem;
  line-height: 1.5rem;
  outline: none;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.fs-input:focus-visible,
.fs-select:focus-visible {
  box-shadow: var(--color-border-active) 0 0 0 1.5px inset;
  outline: 3px solid var(--color-highlight);
  outline-offset: 0;
}

.fs-input::placeholder {
  color: var(--color-text-muted);
}

.fs-select {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.fs-slider {
  background: transparent;
  cursor: pointer;
  height: 1.25rem;
  width: 100%;
}

.fs-slider::-moz-range-track {
  background-color: var(--color-background);
  border-radius: 0.5rem;
  height: 0.5rem;
}

.fs-slider::-webkit-slider-runnable-track {
  background-color: var(--color-background);
  border-radius: 0.5rem;
  height: 0.5rem;
}

.fs-slider::-moz-range-thumb {
  background-color: var(--color-primary);
  border: none; /* Removes extra border that FF applies */
  border-radius: 50%;
  height: 1.25rem;
  width: 1.25rem;
}

.fs-slider::-webkit-slider-thumb {
  appearance: none;
  background-color: var(--color-primary);
  border-radius: 50%;
  height: 1.25rem;
  margin-top: -0.375rem; /* Centers thumb on the track */
  width: 1.25rem;
}

.fs-slider:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.fs-slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.fs-switch-field {
  align-items: center;
  column-gap: 0.75rem;
  display: flex;
  justify-content: space-between;
}

.fs-switch {
  background-color: var(--color-background-alt);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='white'/%3e%3c/svg%3e");
  background-position: left center;
  background-repeat: no-repeat;
  border-radius: 1.5rem;
  cursor: pointer;
  height: 1.5rem;
  transition-duration: 200ms;
  transition-property: background-color, background-position;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  width: 2.75rem;
}

.fs-switch:checked {
  background-color: var(--color-primary);
  background-position: right center;
}

.fs-switch:focus-visible {
  outline: 3px solid var(--color-highlight);
  outline-offset: 0;
}

.fs-textarea {
  min-height: 300px;
  appearance: none;
  border-radius: 0.375rem;
  border-width: 0;
  box-shadow: var(--color-border-default) 0 0 0 1px inset;
  color: var(--color-primary);
  font-size: 1rem;
  line-height: 1.5rem;
  outline: none;
  padding: 0.5rem 0.75rem;
  resize: vertical;
}

.fs-textarea:focus-visible {
  box-shadow: var(--color-border-active) 0 0 0 1.5px inset;
  outline: 3px solid var(--color-highlight);
  outline-offset: 0;
}

.fs-textarea::placeholder {
  color: var(--color-text-muted);
}

/* Footer*/
footer {
  max-width: 280px;
  margin: auto;
  padding: 20px;
  font-size: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-items: center;
  justify-content: space-between;
  row-gap: 10px;
}

.social a img{
  width: 24px;
  height: 24px;
  transition: filter 0.3s ease-in-out;
}

.social a:first-child:hover img {
  filter: invert(27%) sepia(85%) saturate(1642%) hue-rotate(184deg) brightness(93%) contrast(89%);
}

.social a:last-child:hover img {
  filter: invert(14%) sepia(90%) saturate(6000%) hue-rotate(-5deg) brightness(110%) contrast(110%);
}


/* Media Queries */
/* Tablet: Switch to 3 columns */

@media (max-width: 900px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: Switch to 2 column */
@media (max-width: 800px) {
  .cards-container {
    grid-template-columns: 1fr 1fr;
  }

  iframe {
    height: 30vh;
  }
}

/* Mobile: Switch to 1 column */
@media (max-width: 500px) {
  .cards-container {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 16px;
  }

  .about ul,
  .software ul,
  .education ul {
    font-size: 12px;
  }

  .buttons button {
    font-size: 12px;
  }

  .navbar {
    flex-wrap: wrap;
  }

  iframe {
    height: 20vh;
  }

  #lightbox-extra-content p {
    font-size: 12px;
  }
}
