/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
  position: relative; /* For canvas positioning */
}

body.dark-mode {
  background-color: #1a1a1a;
  color: #fff;
}


/* AI Background Animation */
canvas.ai-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  opacity: 0.2;
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #1E3A8A;
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: #22C55E;
}

.theme-toggle {
  cursor: pointer;
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1E3A8A, #3B82F6);
  color: white;
  text-align: center;
  position: relative;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2; 
}


.hero-content h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 3rem;
  animation: bounceIn 0.8s ease-out 0.2s;
}


.hero-content h2 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
  animation: bounceIn 0.8s ease-out 0.4s;
}

.hero-content p {
  animation: bounceIn 0.8s ease-out 0.6s;
}

.cta-buttons {
  margin-top: 2rem;
  animation: bounceIn 0.8s ease-out 0.8s;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  60% {
    opacity: 1;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #22C55E;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  margin: 0.5rem;
  transition: background-color 0.3s;
}

.btn.secondary {
  background-color: transparent;
  border: 2px solid #22C55E;
}

.btn:hover {
  background-color: #16A34A;
}

/* Resume Button */
.resume-button {
  position: absolute;
  top: calc(1rem + 2.5rem + 1rem); /* Below navbar (padding + toggle height + extra space) */
  right: 2rem;
  z-index: 10;
}
/* General Section */
.section {
  padding: 4rem 2rem;
  text-align: center;
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

.section:nth-child(2) { animation-delay: 0.2s; } /* About */
.section:nth-child(3) { animation-delay: 0.4s; } /* Projects */
.section:nth-child(4) { animation-delay: 0.6s; } /* Skills */
.section:nth-child(5) { animation-delay: 0.8s; } /* Contact */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

/* About Section */
.about-content {
  display: flex;
  justify-content: center;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.about-text {
  max-width: 50%;
  text-align: left;
}

.about-image img {
  width: 300px;
  border-radius: 10px;
  animation: zoomIn 1s ease forwards, floatImage  4s ease-in-out infinite;
  animation-delay: 2s,3s;
}

@keyframes zoomIn {
  0%{
    transform: scale(0);
    opacity: 0;
  }

  100%{
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes floatImage{
  0%{
    transform: translateY(0);
  }
  50%{
    transform: translateY(-24px);
  }
  100%{
    transform: translateY(0);
  } 
}
/* Experience Section */
.experience-timeline {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  padding: 2rem 0;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: #22C55E;
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 1rem 2rem;
  margin-bottom: 2rem;
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}

.timeline-content {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .timeline-content {
  background: #2a2a2a;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.timeline-content h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.timeline-date {
  font-size: 1rem;
  color: #22C55E;
  margin-bottom: 0.5rem;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #22C55E;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.timeline-item:nth-child(odd)::after {
  right: -8px;
}

.timeline-item:nth-child(even)::after {
  left: -8px;
}

/* Education Section */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.education-card {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .education-card {
  background: #2a2a2a;
}

.education-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.education-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.education-date {
  font-size: 1rem;
  color: #22C55E;
  margin-bottom: 0.5rem;
}
/* Experience */
.experience-content {
  display: flex;
  justify-content: center;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.experience-text {
  max-width: 50%;
  text-align: left;
}
.typing-upcoming {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  animation: typing-upcoming 2s linear infinite;
}

@keyframes typing-upcoming {
  0% { width: 0; }
  50% { width: 100%; }
  100% { width: 0; }
}

/* Projects Section */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.project-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers card and title */
}

.project-card {
  position: relative;
  background: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  width: 100%; /* Ensures card takes full available width */
}

body.dark-mode .project-card {
  background: #2a2a2a;
}

.project-card:hover {
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.project-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 10px 10px 0 0; /* Only top corners rounded */
  display: block;
}

.project-container h3 {
  margin-top: 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  text-align: center;
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(34, 197, 94, 0.7);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-overlay p {
  color: white;
  margin-bottom: 1rem;
  text-align: center;
}

.project-overlay .btn.small {
  background-color: #fff;
  color: #22C55E;
  border: none;
}

.project-overlay .btn.small:hover {
  background-color: #e0e0e0;
}

/* Skills Section */
.skills-list {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers the entire list */
}

.skill-item {
  width: 100%; /* Ensures full width within max-width of skills-list */
  margin-bottom: 1.5rem; /* Space between items */
  text-align: center; /* Centers text and bar within skill-item */
}

.skill-item p {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.skill-bar {
  background-color: #ddd;
  height: 12px;
  border-radius: 5px;
  overflow: hidden;
  max-width: 300px; /* Controls bar length */
  margin: 0 auto; /* Centers the bar */
}

.progress {
  background-color: #22C55E;
  height: 100%;
  border-radius: 5px;
  transition: width 1.5s ease-out;
}

body.dark-mode .skill-bar {
  background-color: #444;
}
/* Contact Section */
.contact {
  background-color: #1E3A8A;
  color: white;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input, .contact-form textarea {
  padding: 0.75rem;
  border: none;
  border-radius: 5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
  transform: scale(1.02);
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
  outline: none;
}

.contact-form textarea {
  height: 150px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.social-links a {
  color: white;
  font-size: 1.5rem;
}

.social-links a:hover {
  color: #22C55E;
}

/* Chatbot */
.chatbot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.chatbot-toggle {
  background-color: #22C55E;
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 50%;
  cursor: pointer;
}

.chatbot-window {
  background-color: #fff;
  width: 300px;
  height: 400px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  position: absolute;
  bottom: 60px;
  right: 0;
  display: flex;
  flex-direction: column;
}

body.dark-mode .chatbot-window {
  background-color: #2a2a2a;
}

.chatbot-messages {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
}

.chatbot-input {
  padding: 0.75rem;
  border: none;
  border-top: 1px solid #ddd;
  border-radius: 0 0 10px 10px;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  background-color: #f1f1f1;
}

body.dark-mode footer {
  background-color: #2a2a2a;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
      flex-direction: column;
      gap: 1rem;
  }
  .nav-links {
      flex-direction: column;
      gap: 1rem;
  }
  .about-content {
      flex-direction: column;
      text-align: center;
  }
  .about-text {
      max-width: 100%;
  }
  .profile-photo {
      width: 120px;
      height: 120px;
  }
  .hero-content h1 {
      font-size: 2rem;
  }
  .project-card {
      min-width: 250px;
  }
  .skills-slider {
      height: 150px;
  }
}
