/*
 * © 2024 Jaisal E. K. All Rights Reserved.
 */

:root {
  --background-color: #f5f3ef;
  --text-color: #141414;
  --accent-color: #66023c;
  --complementary-color: #2e8b57;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 10px;
  --title-font: "Roboto", sans-serif;
  --body-font: "Source Serif Pro", serif;
}

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

body {
  font-family: var(--body-font);
  color: var(--text-color);
  line-height: 1.3;
  background-color: transparent;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}

.acrylic-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(
    135deg,
	#daa520,
	#4a4a4a,
	#800020,
	#daa520,
	#1a472a,
	#4a4a4a,
	#daa520
  );
  opacity: 0.25;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--title-font);
  color: var(--text-color);
  line-height: 1.1;
}

h1 {
  font-size: 3rem;
  margin-bottom: 0.1em;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 10px;
  margin-top: 40px;
  margin-bottom: 20px;
  font-weight: 700;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  font-weight: 600;
}

h4 {
  font-size: 1rem;
  margin-bottom: 4px;
  font-weight: 500;
}

p {
  margin-bottom: 8px;
  line-height: 1.3;
}

::selection {
    background-color: #fbd714;
    color: #141414;
    text-shadow: none;
}

::-moz-selection {
    background-color: #fbd714;
    color: #141414;
    text-shadow: none;
}

::-webkit-selection {
    background-color: #fbd714;
    color: #141414;
    text-shadow: none;
}

/* Header and Navigation */
header {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.hamburger-menu {
  position: relative;
}

.hamburger-icon {
  width: 40px;
  height: 40px;
  background-color: var(--accent-color);
  border-radius: var(--border-radius);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease,
    transform 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.hamburger-icon span,
.hamburger-icon span::before,
.hamburger-icon span::after {
  display: block;
  width: 24px;
  height: 3px;
  background-color: var(--background-color);
  transition: all 0.3s ease;
  position: absolute;
}

.hamburger-icon span::before {
  content: "";
  top: -8px;
}

.hamburger-icon span::after {
  content: "";
  top: 8px;
}

.menu {
  position: absolute;
  top: calc(100% - 5px);
  right: 0;
  background-color: var(--accent-color);
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: none;
  min-width: 200px;
  border-radius: var(--border-radius);
}

.menu ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.menu ul li {
  margin-bottom: 5px;
  position: relative;
}

.menu ul li a {
  font-family: var(--title-font);
  color: var(--background-color);
  text-decoration: none;
  font-weight: 400;
  transition: all 0.3s ease;
  display: block;
  padding: 8px 12px;
  line-height: 1.1;
  border-radius: var(--border-radius);
}

.has-submenu > a::after {
  content: "▼";
  font-size: 0.7em;
  margin-left: 5px;
}

.submenu {
  display: none;
  padding-left: 15px;
  margin-top: 5px;
}

.submenu a {
  padding: 6px 12px 6px 20px !important;
}

/* Hamburger Menu Animation */
.hamburger-menu.active .hamburger-icon {
  background-color: var(--accent-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.hamburger-menu.active .hamburger-icon span {
  background-color: transparent;
}

.hamburger-menu.active .hamburger-icon span::before {
  top: 0;
  transform: rotate(45deg);
}

.hamburger-menu.active .hamburger-icon span::after {
  top: 0;
  transform: rotate(-45deg);
}

.hamburger-menu.active .menu {
  display: block;
  border-top-right-radius: 0;
}

/* Main Content */
main {
  padding-top: 0;
}

/* Home Section */
#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
}

.hero-image {
  flex: 1;
}

.hero-text {
  flex: 2;
}

.profile-image {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background-color: transparent;
}

.subtitle {
  font-family: var(--title-font);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent-color);
  margin-bottom: 1em;
  line-height: 1.1;
}

.subtitle-link {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.description {
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 1.5em;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--accent-color);
  border-radius: var(--border-radius);
  transition: background-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.social-icon img {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

/* Publications Section */
#publications {
  margin-top: 40px;
}

.publication-type {
  margin-bottom: 20px;
}

.publication-item {
  background-color: rgba(245, 243, 239, 0.7);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hanging-indent {
  padding-left: 1.5em;
  text-indent: -1.5em;
  margin-bottom: 8px;
  line-height: 1.3;
  font-size: 0.9rem;
}

.publication-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background-color: var(--accent-color);
  color: var(--background-color);
  border-radius: var(--border-radius);
  text-decoration: none;
  font-family: var(--title-font);
  font-size: 0.75em;
  line-height: 1.2;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.link-icon::after {
  content: "\2197";
  font-size: 1em;
  margin-left: 4px;
  display: inline-block;
}

/* Education Section */
.education-timeline {
  position: relative;
  padding: 20px 0;
  max-width: 800px;
  margin: 0 auto;
}

.education-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background-color: var(--accent-color);
}

.education-item {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 30px;
  position: relative;
  width: 50%;
  left: 50%;
}

.education-item:nth-child(even) {
  justify-content: flex-start;
  left: 0;
}

.education-year {
  position: absolute;
  top: 0;
  left: -110px;
  background-color: var(--accent-color);
  color: var(--background-color);
  padding: 3px 8px;
  border-radius: var(--border-radius);
  font-weight: bold;
  font-size: 0.85rem;
  font-family: var(--title-font);
  line-height: 1.1;
}

.education-item:nth-child(even) .education-year {
  left: auto;
  right: -110px;
}

.education-content {
  background-color: rgba(245, 243, 239, 0.7);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  width: calc(100% - 30px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.education-content h3 {
  color: var(--accent-color);
  margin-bottom: 10px;
  line-height: 1.1;
  font-family: var(--title-font);
}

.education-content p {
  font-size: 0.9rem;
  line-height: 1.3;
  font-family: var(--body-font);
}

.university-link {
  color: var(--accent-color);
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s ease;
  font-family: var(--body-font);
  line-height: 1.3;
}

/* Teaching Assistance Section */
#ta .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.teaching {
  background-color: rgba(245, 243, 239, 0.7);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 20px;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  overflow: hidden;
}

.teaching .card-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.teaching .semester,
.teaching .institution {
  font-size: 0.7rem;
  color: var(--text-color);
  font-weight: 600;
  font-family: var(--body-font);
  line-height: 1.3;
}

.teaching .card-header h3 {
  font-size: 1rem;
  color: var(--accent-color);
  line-height: 1.1;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 3.3em;
  font-family: var(--title-font);
}

.teaching .instructor-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 10px;
  display: inline-block;
  background-color: rgba(102, 2, 60, 0.1);
  padding: 2px 5px;
  border-radius: 3px;
  max-width: 100%;
  box-sizing: border-box;
  font-family: var(--body-font);
  line-height: 1.3;
}

.teaching .instructor-names {
  font-size: 0.9rem;
  line-height: 1.3;
  font-family: var(--body-font);
}

.teaching .instructor-names a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
  margin-bottom: 5px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  font-family: var(--body-font);
  line-height: 1.3;
}

.teaching .instructor-names a:not(:last-child) {
  border-bottom: 1px solid rgba(102, 2, 60, 0.2);
  padding-bottom: 5px;
  margin-bottom: 5px;
}

/* Internships Section */
#internships .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.internship {
  background-color: rgba(245, 243, 239, 0.7);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 20px;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "title"
    "spacer"
    "details";
}

.internship-details {
  display: contents;
}

.internship-details h3 {
  grid-area: title;
  font-size: 1.2rem;
  margin-bottom: 15px;
  line-height: 1.1;
  font-family: var(--title-font);
}

.internship-details h3 a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
  font-family: var(--title-font);
  line-height: 1.1;
}

.internship-info {
  grid-area: details;
  align-self: end;
}

.internship-location,
.internship-duration,
.internship-supervisor {
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  color: var(--text-color);
  font-family: var(--body-font);
  line-height: 1.3;
}

.icon {
  margin-right: 8px;
}

.location-icon,
.calendar-icon,
.supervisor-icon {
  width: 14px;
  height: 14px;
  fill: #66023c;
}

.internship-supervisor a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

/* Additional Courses Section */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.course-card {
  background-color: rgba(245, 243, 239, 0.7);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.course-title {
  font-size: 1rem;
  line-height: 1.1;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 4.4em;
  font-family: var(--title-font);
}

.course-title a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.course-institution {
  font-size: 0.9rem;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
  height: 1.3em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-bottom: 3px;
  font-family: var(--body-font);
}

.course-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-color);
  line-height: 1.3;
  margin-top: 10px;
}

.course-platform,
.course-date {
  display: inline-block;
  background-color: rgba(102, 2, 60, 0.1);
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  font-family: var(--body-font);
}

.course-platform {
  margin-right: 5px;
}

.course-skills {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 24px;
}

.skill-icon {
  width: 20px;
  height: 20px;
}

.course-footer {
  align-self: end;
}

.certificate-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background-color: var(--accent-color);
  color: var(--background-color);
  border-radius: var(--border-radius);
  text-decoration: none;
  font-family: var(--title-font);
  font-size: 0.75em;
  line-height: 1.2;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.certificate-link::after {
  content: "\2197";
  font-size: 1em;
  margin-left: 4px;
  display: inline-block;
}

/* Footer */
footer {
  background-color: var(--accent-color);
  color: var(--background-color);
  padding: 20px 0;
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80px;
}

footer .container {
  text-align: center;
}

footer p {
  font-family: var(--title-font);
  margin: 0;
  line-height: 1.1;
  font-size: 0.8rem;
}

footer a {
  font-family: var(--title-font);
  color: var(--background-color);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.3s ease;
  line-height: 1.1;
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--accent-color);
  color: var(--background-color);
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  padding: 0;
}

.scroll-to-top::before {
  content: "\2303";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 28px;
  line-height: 1;
  transform: translateY(5px) scaleX(1.5);
  font-weight: normal;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-image,
  .hero-text {
    flex: 1;
  }

  .profile-image {
    width: 200px;
    height: 200px;
  }

  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 1.8rem;
  }
  h3 {
    font-size: 1.2rem;
  }
  .subtitle {
    font-size: 1.1rem;
  }
  .description {
    font-size: 0.95rem;
  }

  .hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
  }

  .menu {
    width: 200px;
  }

  .social-icons {
    justify-content: center;
  }

  .social-icon {
    width: 35px;
    height: 35px;
  }

  .social-icon img {
    width: 18px;
    height: 18px;
  }

  .hanging-indent {
    font-size: 0.85rem;
    line-height: 1.3;
    padding-left: 1.2em;
    text-indent: -1.2em;
  }

  .publication-item {
    padding: 12px;
  }

  .link-icon {
    padding: 5px 10px;
    font-size: 0.7em;
  }

  .link-icon::after {
    font-size: 0.9em;
    margin-left: 3px;
  }

  .education-timeline::before {
    left: auto;
    right: 15px;
  }

  .education-item,
  .education-item:nth-child(even) {
    justify-content: flex-start;
    left: 0;
    width: 100%;
    padding-left: 0;
    padding-right: 50px;
  }

  .education-year,
  .education-item:nth-child(even) .education-year {
    left: auto;
    right: 0;
    font-size: 0.8rem;
    padding: 2px 6px;
  }

  .education-content {
    width: calc(100% - 65px);
    margin-right: 65px;
  }

  #ta .card-grid,
  #internships .card-grid,
  .course-grid {
    grid-template-columns: 1fr;
  }

  .teaching,
  .internship,
  .course-card {
    height: auto;
  }

  .teaching .card-header h3,
  .course-title,
  .course-institution,
  .course-details {
    height: auto;
    -webkit-line-clamp: initial;
    white-space: normal;
    overflow: visible;
  }

  .internship-details h3 {
    font-size: 1.1rem;
  }

  .internship-location,
  .internship-duration,
  .internship-supervisor {
    font-size: 0.85rem;
  }

  .location-icon,
  .calendar-icon,
  .supervisor-icon {
    width: 12px;
    height: 12px;
  }

  .skill-icon {
    width: 18px;
    height: 18px;
  }

  .certificate-link {
    padding: 5px 10px;
    font-size: 0.7em;
  }

  .certificate-link::after {
    font-size: 0.9em;
    margin-left: 3px;
  }

  footer p {
    font-size: 0.6rem;
  }

  footer {
    padding: 15px 0;
    min-height: 60px;
  }

  .scroll-to-top {
    display: none !important;
  }
}

@media (min-width: 1200px) {
  .container {
    padding: 0 60px;
  }
  .description {
    font-size: 1.2rem;
  }
}

/* Hover-specific styles */
@media (hover: hover) {
  .hamburger-icon:hover,
  .social-icon:hover {
    background-color: var(--complementary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
  }

  .menu ul li a:hover,
  .submenu a:hover {
    background-color: var(--complementary-color);
    color: var(--background-color);
    font-weight: bold;
  }

  .has-submenu:hover > .submenu {
    display: block;
    background-color: var(--accent-color);
  }

  .subtitle-link:hover,
  .university-link:hover,
  .teaching .instructor-names a:hover,
  .internship-supervisor a:hover,
  footer a:hover {
    color: var(--complementary-color);
  }

  .social-icon:hover img {
    transform: scale(1.1);
  }

  .publication-item:hover,
  .education-content:hover,
  .teaching:hover,
  .internship:hover,
  .course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }

  .link-icon:hover,
  .certificate-link:hover,
  .scroll-to-top:hover {
    background-color: var(--complementary-color);
    transform: translateY(-1px);
  }

  .internship-details h3 a:hover,
  .course-title a:hover {
    color: var(--complementary-color);
    text-decoration: none;
  }
}

/* Touch device styles */
@media (hover: none) {
  .hamburger-icon:active,
  .menu ul li a:active,
  .social-icon:active,
  .link-icon:active,
  .certificate-link:active,
  .scroll-to-top:active {
    background-color: var(--complementary-color);
  }

  .subtitle-link:active,
  .university-link:active,
  .internship-details h3 a:active,
  .course-title a:active,
  footer a:active {
    color: var(--complementary-color);
  }

  .teaching .instructor-names a:active,
  .internship-supervisor a:active {
    color: var(--accent-color);
  }

  .scroll-to-top:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }
}
