/* Color Scheme */
:root {
  --primary: #2a3b4c;
  --secondary: #3fc5f0;
  --accent: #ff6b6b;
  --light: #f5f5f5;
  --dark: #1a2634;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  background-color: var(--primary);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 60px; /* Reduced from 100px to 60px */
}

.logo {
  color: var(--light);
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 2rem;
}

.nav-links a {
  color: var(--light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--secondary);
}

.hamburger {
  display: none;
  cursor: pointer;
  color: var(--light);
  font-size: 1.5rem;
}

/* Hero Section */
.hero {
  height: 100vh;
  background: linear-gradient(135deg, var(--primary), var(--dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light);
  text-align: center;
  padding: 0 1rem;
}

.hero-content {
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1;
  min-width: 300px;
  padding: 2rem;
  text-align: left;
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-text h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--secondary);
}

.hero-text p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.profile-image {
  flex: 1;
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  
  will-change: transform; /* Optimize animation performance */
  transform-style: preserve-3d; /* Enhance 3D effect */
}

.profile-image img {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 5px solid var(--secondary);
  object-fit: cover;
  box-shadow: 0 0 25px rgba(63, 197, 240, 0.5);
}

.profile-animate {
  animation: float 3s ease-in-out infinite;
  transform: translateZ(0); /* Force hardware acceleration */
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}

.btn {
  display: inline-block;
  background-color: var(--accent);
  color: var(--light);
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  margin-right: 1rem;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--secondary);
  color: var(--secondary);
}

.btn-outline:hover {
  background-color: var(--secondary);
  color: var(--dark);
}

/* Section Styles */
section {
  padding: 5rem 10%;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--primary);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--secondary);
}

/* About Section */
.about {
  background-color: white;
  font-size: larger;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two equal columns */
  gap: 2rem;
  align-items: start;
}

.about-text {
  grid-column: 1; /* Place in the first column */
  min-width: 300px;
}

.skill-item {
  display: inline-block; /* Display items inline */
  margin: 0 0.5rem; /* Add spacing between items */
  position: relative;
  /* font-size: 1rem;
  font-weight: bold; */
  color: var(--dark);
}

.skill-item::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--secondary);
  margin-top: 0.2rem;
  transition: width 0.3s ease;
}

.skill-item:hover::after {
  width: 120%; /* Slightly increase the underline width on hover */
}

/* Academic Section */
.academic {
  background-color: #f9f9f9;
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::after {
  content: "";
  position: absolute;
  width: 4px;
  background-color: var(--primary);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  background-color: inherit;
  box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-item::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  right: -12px;
  background-color: var(--light);
  border: 4px solid var(--accent);
  top: 20px;
  border-radius: 50%;
  z-index: 1;
}

.timeline-item:nth-child(even)::after {
  left: -12px;
}

.timeline-content {
  padding: 20px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.timeline-date {
  color: var(--secondary);
  font-weight: bold;
}

.timeline-title {
  margin: 10px 0;
  color: var(--primary);
}

/* Work Section */
.work {
  background-color: white;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.project {
  background-color: var(--light);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.project:hover {
  transform: translateY(-10px);
}

.project-img {
  height: 200px;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-info {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tech-tag {
  background-color: var(--secondary);
  color: var(--dark);
  padding: 0.3rem 0.8rem;
  border-radius: 30px;
  font-size: 0.8rem;
}

/* Contact Section */
.contact {
  background-color: #f9f9f9;
}

.contact-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.contact-info {
  flex: 1;
  min-width: 300px;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.contact-icon {
  background-color: var(--primary);
  color: var(--light);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 1rem;
}

.contact-form {
  flex: 1;
  min-width: 300px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

textarea.form-control {
  height: 150px;
  resize: vertical;
}

.submit-btn {
  background-color: var(--accent);
  color: var(--light);
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.submit-btn:hover {
  background-color: #ff5151;
}

/* Footer */
footer {
  background-color: var(--primary);
  color: var(--light);
  text-align: center;
  padding: 2rem;
}

.social-links {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.social-link {
  color: var(--light);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(0, 0, 0);
  border-radius: 50%;
  margin: 0 0.5rem;
  text-decoration: none;
  transition: all 0.3s;
}

.social-link:hover {
  background-color: rgba(0, 0, 0, 0.481);
  color: var(--dark);
} 

/* Scroll-to-Top Arrow */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background-color: var(--accent);
  color: var(--light);
  border-radius: 50%;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 25px;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.scroll-to-top:hover {
  background-color: var(--secondary);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 991px) {
  .section-title {
    font-size: 2rem;
  }

  section {
    padding: 4rem 5%;
  }

  .projects {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 60px; /* Match exact navbar height */
    left: -100%;
    background-color: var(--primary);
    width: 100%;
    flex-direction: column;
    align-items: center;
    padding: 0; /* Remove padding */
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Add subtle border */
  }

  .nav-links li {
    width: 100%;
    margin: 0;
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-links.active {
    left: 0;
  }

  .hero {
    margin-top: 60px; /* Match navbar height */
    min-height: calc(100vh - 60px);
    height: auto; /* Allow section to grow with content */
  }

  .hero-content {
    flex-direction: column-reverse;
    padding-top: 2rem;
  }

  .profile-image {
    min-width: 250px;
    padding: 1rem;
    margin-top: 2rem; /* Add space above profile image */
  }

  .timeline::after {
    left: 31px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-item:nth-child(even) {
    left: 0;
  }

  .timeline-item::after {
    left: 19px;
    right: auto;
  }

  .contact-content {
    flex-direction: column;
  }

  .project {
    max-width: 100%;
  }

  .hero-text {
    text-align: center;
    padding: 1rem;
  }

  .about-text, .skills-content {
    padding: 0 1rem;
  }

  .skill-item {
    margin: 0.3rem;
    font-size: 0.9rem;
  }

  .section-title {
    margin-bottom: 2rem;
  }
}

@media (max-width: 576px) {
  .hero-text h1 {
    font-size: 2.2rem;
  }

  .hero-text h2 {
    font-size: 1.2rem;
  }

  .profile-image img {
    width: 220px;
    height: 220px;
  }

  .hero {
    margin-top: 50px;
    min-height: calc(100vh - 50px);
  }

  .profile-image {
    margin-top: 1.5rem;
  }

  section {
    padding: 3rem 1rem;
  }

  .navbar {
    padding: 0.8rem 1rem;
  }

  .contact-icon {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .timeline-content {
    padding: 15px;
  }

  .form-control {
    padding: 0.6rem;
  }

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

  .scroll-to-top {
    width: 35px;
    height: 35px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 400px) {
  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-text h2 {
    font-size: 1rem;
  }

  .profile-image img {
    width: 180px;
    height: 180px;
  }

  .btn {
    display: block;
    margin-bottom: 1rem;
    text-align: center;
  }
}