/* This is the required project styling. Will contain essential CSS styles like:
   * Flex property
   * Grid layout
   * Cards and sections
*/

@import url(https://fonts.googleapis.com/css?family=Raleway:100,200,300,regular,500,600,700,800,900,100italic,200italic,300italic,italic,500italic,600italic,700italic,800italic,900italic);

/* variables */
:root {
  /* Colors */
  --primary-color: #ffcd42;
  --secondary-color: #ffd35c;
  --bg-primary: #000000;
  --text-color: #ffffff;
  --text-color-two: #c2e9f7;
  --bg-secondary: #ffffff;
  --card-background: #111111;
  --bg-secondary-two: #f4f4f4;
  --shadow: 0 2px 10px rgba(95, 95, 95, 0.2);

  /* Font Weight */
  --weight-small: 400;
  --weight-semibold: 600;
  --weight-bold: 800;

  /* Max width */
  --width-small: 600px;
  --width-medium: 1100px;
  --width-large: 1300px;
}

[data-theme="light"] {
  --primary-color: #ffcd42;
  --secondary-color: #ffd35c;
  --bg-primary: #ffffff;
  --text-color: #222222;
  --text-color-two: #ffffff;
  --bg-secondary: #000000;
  --card-background: #f4f4f4;
  --bg-secondary-two: #111111;

  --shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

/* Reset default styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

ul {
  list-style: none;
}

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

/* Main styling */
body {
  background: var(--bg-primary);
  color: var(--text-color);
  font-family: "Raleway", sans-serif;
  line-height: 1.5;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: transparent;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  height: 80px;
  width: 100%;
}

.navbar .nav-menu {
  display: flex;
  align-items: center;
  background: transparent;
}

.navbar .nav-link {
  margin: 0 1rem;
  font-size: 0.8rem;
  font-weight: var(--weight-semibold);
}

.navbar .nav-link.active-page {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 2px;
}

.navbar #logo img {
  display: block;
  width: 40px;
}

.navbar .btn {
  margin-right: 1.5rem;
}

.fas.fa-arrow-right {
  margin-left: 0.5rem;
  font-size: 0.9rem;
}

/* hamburger */
.hamburger {
  margin-bottom: 0.1rem;
  display: none;
}

.bar {
  display: block;
  width: 23px;
  height: 3px;
  margin: 4px auto;
  transition: all 0.3s ease-in-out;
  border-radius: 30px;
  background-color: var(--bg-secondary);
}

/* Hero section */
#hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
}

#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../assets/dna-hero-bg.png') center/cover no-repeat;
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
}

#bio-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.65;
  pointer-events: none;
  /* Let clicks pass through, JS will track mouse separately */
}

/* Ensure contents are above the canvas */
#hero>.navbar,
#hero>.header-container {
  position: relative;
  z-index: 10;
}

.profile-image {
  width: 150px;
  border-radius: 50%;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from {
    transform: translateY(0px);
  }

  to {
    transform: translateY(-10px);
  }
}

.division {
  width: 100%;
  height: 2px;
  background-color: var(--card-background);
  margin: 0.5rem 0;
  /* Reduced from 5.5rem to decrease space between sections */
}

/* Projects */
#projects {
  display: flex;
  flex-direction: column;
  margin: 2rem auto 5rem;
}

#projects .btn {
  align-self: center;
  margin: 2rem 0;
}

.project {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(320px, auto);
  /* Increased from 250px to fit more text */
  grid-gap: 0.9rem;
}

.card .project-bio p {
  font-size: 0.83rem;
  line-height: 1.3;
  color: var(--text-color-two, #ffffff);
}

.card .project-bio p:nth-of-type(1) {
  margin-bottom: 0.4rem;
}

.card .project-bio p:nth-of-type(2) {
  font-style: italic;
  font-weight: 300;
  opacity: 0.85;
}

.card .project-bio h3 {
  font-size: 1.05rem;
  color: var(--primary-color);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
  margin-bottom: 0.3rem;
}

.project-info {
  display: flex;
  justify-content: space-between;
  opacity: 0;
  position: relative;
  transition: 0.5s ease-in-out;
  height: 100%;
  /* Take full height of the card */
}

.project-bio {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 60%, rgba(0, 0, 0, 0) 100%);
  padding: 15px;
  width: 100%;
  border-radius: 0 0 5px 5px;
}

/* Coursework Styles */
.coursework-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 5rem;
}

.coursework-card {
  background: linear-gradient(145deg, var(--bg-primary) 0%, rgba(255, 205, 66, 0.05) 100%);
  border: 1px solid rgba(255, 205, 66, 0.2);
  border-left: 3px solid var(--primary-color);
  padding: 1.5rem;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.coursework-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 205, 66, 0.15);
}

.coursework-header {
  display: flex;
  align-items: cener;
  margin-bottom: 1rem;
}

.coursework-header h3 {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.course-id {
  font-size: 0.85rem;
  color: var(--text-color-two);
  opacity: 0.8;
  font-family: monospace;
}

.coursework-card p {
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.coursework-skills {
  margin-top: auto;
  border-top: 1px solid rgba(255, 205, 66, 0.1);
  padding-top: 1rem;
}

.coursework-skills h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-color-two);
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.coursework-skills p {
  font-size: 0.85rem;
  color: var(--primary-color);
  margin-bottom: 0;
  opacity: 0.9;
}

/* Publications Styles */
.publication-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.publication-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: linear-gradient(145deg, rgba(30, 30, 30, 0.6) 0%, rgba(255, 205, 66, 0.05) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 205, 66, 0.15);
  border-left: 4px solid var(--primary-color);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.publication-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255, 205, 66, 0.03), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.publication-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px -10px rgba(255, 205, 66, 0.2);
  border-color: rgba(255, 205, 66, 0.4);
}

.publication-item:hover::before {
  transform: translateX(100%);
}

.publication-icon {
  color: var(--primary-color);
  font-size: 2rem;
  margin-top: 0.2rem;
  background: rgba(255, 205, 66, 0.1);
  padding: 15px;
  border-radius: 12px;
  box-shadow: inset 0 0 10px rgba(255, 205, 66, 0.05);
}

.publication-content {
  flex: 1;
}

.publication-title {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
  line-height: 1.5;
  text-transform: uppercase;
}

.publication-authors {
  color: var(--text-color);
  font-size: 1rem;
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.publication-authors strong {
  color: var(--primary-color); /* Highlight user's name with primary color */
  font-weight: 700;
}

.publication-journal {
  color: var(--text-color-two);
  font-size: 0.95rem;
  margin-bottom: 1.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.publication-journal i {
  color: var(--primary-color);
  font-size: 0.8rem;
}

.publication-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
}

.publication-actions .btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.btn-secondary {
  background: rgba(255, 205, 66, 0.05);
  color: var(--primary-color);
  border: 1px solid rgba(255, 205, 66, 0.3);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: #111111;
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(255, 205, 66, 0.4);
}

.cite-btn {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  transition: all 0.3s ease;
}

.cite-btn:hover {
  background: #333;
  border-color: #555;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Footer */
#footer {
  background: #111111;
}

#footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  min-height: 160px;
  text-align: center;
}

#footer a {
  font-size: 0.8rem;
  color: #fff;
}

#footer a:hover {
  opacity: 0.6;
}

#footer .social {
  margin: 0.9rem 0;
}

#footer .social img {
  width: 20px;
  height: 20px;
}

#footer .social a {
  margin: 0 0.5rem;
}

#footer p {
  font-size: 0.8rem;
}

/* Responsiveness */

@media (max-width: 1000px) {
  .project {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {}

@media (max-width: 670px) {
  .navbar .nav-menu {
    position: fixed;
    right: -100vw;
    top: 4.5rem;
    flex-direction: column;
    width: calc(80% - 10px);
    transition: 0.3s;
    box-shadow: var(--shadow);
    padding: 2rem;
    border-radius: 5px;
    align-items: flex-start;
  }

  .navbar .btn {
    margin: 0;
    margin-top: 1rem;
  }

  .nav-menu.active {
    right: 20px;
  }

  .nav-menu .nav-link {
    font-size: 0.9rem;
    margin: 0 0.2rem;
  }

  .nav-menu li {
    margin-bottom: 0.5rem;
    width: 100%;
  }

  .nav-menu .btn {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
  }

  .hamburger {
    display: block;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
  }

  .hamburger.active {
    border: 1px dotted gray;
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

@media (max-width: 600px) {
  .project {
    display: grid;
    grid-template-columns: 1fr;
  }

  .header-container .btn {
    border-radius: 5px;
    width: 80%;
  }
}

/* --- Scenic Theme Toggle Switch --- */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 65px;
  height: 32px;
  margin-left: 1rem;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-icons {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../assets/night.jpg') center/cover no-repeat;
  transition: .4s;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.scenery {
  position: absolute;
  width: 100%;
  height: 100%;
  transition: 0.4s;
  background: url('../assets/day.jpg') center/cover no-repeat;
  opacity: 0; /* Hidden in night mode */
}

/* The Moon (Default) -> Sun (Checked) Slider */
.slider-scenery {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: #f1f2f6; /* Moon color */
  border-radius: 50%;
  transition: .4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: inset -3px -3px 0 0px #dcdde1, 0 0 10px rgba(255, 255, 255, 0.5);
  z-index: 2;
}

/* --- Checked State (Light Mode) --- */
input:checked + .toggle-icons .scenery {
  opacity: 1; /* Show day image in light mode */
}

input:checked + .toggle-icons {
  border-color: #55a6df;
}

input:checked + .toggle-icons .slider-scenery {
  transform: translateX(33px);
  background-color: #ffda79; /* Sun color */
  box-shadow: inset 0px 0px 0 0px rgba(0,0,0,0), 0 0 15px #ffcd42, 0 0 30px #ffcd42;
}