/* main.css */
html {
  height: 100%; /* Ensure html takes up full height */
}
body {
  margin: 0;
  padding: 0;
  min-height: 100vh; /* Ensure body takes up full viewport height */
  display: flex;
  flex-direction: column;
}


.container-fluid {
  flex: 1 0 auto; /* Allow content to grow and shrink, but not smaller than its content */
}

main {
  background-image: url(../img/IMG_5358.jpg);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
}

/* Hero Section Styles (Important Adjustments) */
#hero {
  position: relative;
  width: 100%;
  display: flex;
  min-height: 100vh;
  flex-direction: column; /* Stack content vertically */
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh; /* Ensure hero takes full viewport height */
  padding-top: 76px; /* Account for fixed header height */
  box-sizing: border-box; /* Include padding in height calculation */

}

#hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent); /* Darker overlay */
  z-index: 1;
}

.hero-content {
  position: relative;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 2rem;
  border-radius: 10px;
  z-index: 2;
  max-width: 768px;
  margin: 0 auto;
}

.hero-text, .typing-text {
  color: white;
  text-shadow: 2px 2px 4px #000000; /* Subtle black text shadow */
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1030;
  transition: background-color 0.3s ease, padding 0.3s ease;
}

.header.scrolled {
  background-color: rgba(0, 0, 0, 0.9);
  padding: 0.5rem 0;
}

.navbar {
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.3) !important; /* This is KEY for transparency */
  transition: padding 0.3s ease;
}

.navbar.scrolled {
  background-color: rgba(0, 0, 0, 0.9);
  padding: 0;
}

.navbar-dark .navbar-nav .nav-link,
.navbar-dark .navbar-brand {
  color: white;
  transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-brand:hover {
  color: #007bff;
}

/* Dropdown Styles */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
}

.navbar .dropdown:hover>.dropdown-menu {
  display: block;
}

.dropdown-submenu:hover>.dropdown-menu {
  display: block;
}


/* Social Links Styles */
.social-links {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 10px;
  font-size: 1.5rem;
  color: white;
  text-decoration: none;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.social-icon:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.typing-text {
  font-size: 3rem;
  font-weight: bold;
  overflow: hidden;
  white-space: nowrap;
  border-right: 0.15em solid orange;
  animation: 
      typing 3.5s steps(40, end) forwards,
      blink-caret .75s step-end infinite;
  color: white;
  word-wrap: break-word; /* Add this for word wrapping */
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: orange; }
}

#about {
  background-color: #e9ecef;
  padding: 3rem 0;
  min-height: 100vh; /* Ensure at least full viewport height */
  display: flex; /*Enable flexbox for vertical centering*/
  flex-direction: column;
  justify-content: center; /*Vertically center content*/
}
#about .container{
  flex: 1; /* Allow the container to expand */
  display: flex;
  flex-direction: column;
}
#about .container .row{
  flex: 1;
}

.side-heading {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #333;
  position: relative;
  padding-bottom: 0.5rem;
  display: inline-block;
  transition: color 0.3s ease, text-shadow 0.3s ease; /* Add transitions */
}

.side-heading:hover {
  color: #007bff; /* Change color on hover */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2); /* Add subtle shadow on hover */
}

.side-heading::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 3px;
  background-color: #007bff;
  transition: width 0.3s ease; /* Transition width on hover */
}

.side-heading:hover::after {
  width: 75%; /* Extend underline on hover */
}
/* More pronounced 3D effect (using transform) */
.side-heading-3d {
  font-size: 1.7rem;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin: 2rem auto;
  display: block;
  position: relative;
  overflow: hidden; /* Important for clipping the animation */
  transition: color 0.3s ease;
}

.side-heading-3d:hover {
  color: #007bff;
}

.side-heading-3d span {
  display: inline-block; /* Make each letter a block */
  transition: transform 0.3s ease;
}

.side-heading-3d:hover span {
  transform: translateY(-5px) rotate(5deg); /* Move letters up and rotate */
}

/* Add a slight delay to each letter for a staggered effect */
.side-heading-3d span:nth-child(1) { transition-delay: 0.05s; }
.side-heading-3d span:nth-child(2) { transition-delay: 0.1s; }
.side-heading-3d span:nth-child(3) { transition-delay: 0.15s; }
.side-heading-3d span:nth-child(4) { transition-delay: 0.2s; }
.side-heading-3d span:nth-child(5) { transition-delay: 0.25s; }
.side-heading-3d span:nth-child(6) { transition-delay: 0.3s; }
.side-heading-3d span:nth-child(7) { transition-delay: 0.35s; }
.side-heading-3d span:nth-child(8) { transition-delay: 0.4s; }
.side-heading-3d span:nth-child(9) { transition-delay: 0.45s; }
/* Add more as needed */

/* Optional: Add a subtle background animation */
.side-heading-3d::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 123, 255, 0.2), transparent); /* Light blue gradient */
  transform: translateX(-100%); /* Start off-screen */
  transition: transform 0.5s ease;
  z-index: -1;
}

.side-heading-3d:hover::before {
  transform: translateX(0); /* Move gradient across on hover */
}
/* Timeline Styles */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: #007bff;
  transform: translateX(-50%);
}

.timeline-item {
  margin-bottom: 2rem;
  display: flex;
  position: relative;
  width: 100%;
  padding: 10px 0;
  align-items: flex-start; /* Important for vertical alignment */
}

.timeline-date {
  width: 120px;
  color: #777;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

.timeline-item:hover .timeline-date {
  color: #333;
}

.timeline-item:hover {
  transform: scale(1.02);
}

.timeline-item:hover .timeline-content {
  box-shadow: 0 1rem 1.5rem rgba(0, 0, 0, 0.2);
  transform: scale(1.03);
}

/* Corrected alternating using flex direction */
.timeline-item:nth-child(odd) {
  flex-direction: row-reverse; /* Date on the left for odd items */
}

.timeline-item:nth-child(even) {
  flex-direction: row; /* Date on the right for even items */
}

/* Corrected Date Positioning */
.timeline-item:nth-child(odd) .timeline-date {
  right: calc(50% + 20px); /* Position on the right */
  text-align: left;
}

.timeline-item:nth-child(even) .timeline-date {
  left: calc(50% + 20px); /* Position on the left */
  text-align: right;
}

.timeline-content {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  max-width: 400px;
  box-sizing: border-box;
  min-height: 100px;
  flex-grow: 1;
  overflow: hidden;
  position: relative;
}

.timeline-content-wrapper {
  margin: 0 160px;
  flex-grow: 1;
  display: flex;
}

.timeline-content::before {
  content: "";
  position: absolute;
  border-style: solid;
  top: 15px;
  border-width: 10px 10px 10px 0;
  border-color: transparent white transparent transparent;
  transition: border-color 0.3s ease;
  left: -10px; /* Position on the left by default */
}

.timeline-item:nth-child(even) .timeline-content::before {
  left: auto;
  right: -10px; /* Position on the right for even items */
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent white;
}

.timeline-item:hover .timeline-content::before {
  border-color: transparent #007bff transparent transparent; /* Hover color for odd */
}

.timeline-item:nth-child(even):hover .timeline-content::before {
  border-color: transparent transparent transparent #007bff; /* Hover color for even */
}


.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.project-image {
  position: relative;
  overflow: hidden;
}

.project-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.overlay-content {
  color: white;
  text-align: center;
  padding: 20px;
}

.overlay-content h3 {
  margin-bottom: 10px;
}
.overlay-content p {
  display: flex; /* Use flexbox */
  flex-direction: column; /* Set flex direction to column */
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.overlay-content .btn{
  margin-top: 10px;
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.project-image {
  position: relative;
  overflow: hidden;
}

.project-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.overlay-content {
  color: white;
  text-align: center;
  padding: 20px;
}

.overlay-content h3 {
  margin-bottom: 10px;
}
.overlay-content p {
  display: flex; /* Use flexbox */
  flex-direction: column; /* Set flex direction to column */
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.overlay-content .btn{
  margin-top: 10px;
}

.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: #007bff;
  transform: translateX(-50%);
}

.timeline-item {
  margin-bottom: 2rem;
  display: flex;
  position: relative;
  width: 100%;
  padding: 10px 0;
  align-items: flex-start;
}

.timeline-item:hover {
  transform: scale(1.02);
}

.timeline-item:hover .timeline-content {
  box-shadow: 0 1rem 1.5rem rgba(0, 0, 0, 0.2);
  transform: scale(1.03);
}

.timeline-date {
  /* width: 120px; Remove fixed width */
  min-width: 120px; /* Use min-width instead */
  color: #777;
  padding: 0.5rem 1rem; /* Reduced vertical padding */
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap; /* Prevent text from wrapping */
}

.timeline-item:hover .timeline-date {
  color: #333;
}

/* Corrected alternating using flex direction */
.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
}

.timeline-item:nth-child(even) {
  flex-direction: row;
}

/* Corrected Date Positioning (More Consistent) */
.timeline-item:nth-child(odd) .timeline-date {
  left: calc(35% + 20px);
  text-align: left;
}

.timeline-item:nth-child(even) .timeline-date {
  right: calc(50% + 20px);
  text-align: right;
}

.timeline-content {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  max-width: 400px; /* Set a max-width */
  margin: 0 20px;
  box-sizing: border-box;
  position: relative;
  min-height: 100px;
  flex-grow: 1;
}

.timeline-content::before {
  content: "";
  position: absolute;
  border-style: solid;
  top: 15px;
  border-width: 10px 10px 10px 0;
  border-color: transparent white transparent transparent;
  transition: border-color 0.3s ease;
}

.timeline-item:hover .timeline-content::before {
  border-color: transparent #007bff transparent transparent;
}

.timeline-item:nth-child(even) .timeline-content::before {
  left: auto;
  right: -10px;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent white;
}

.timeline-item:nth-child(even):hover .timeline-content::before {
  border-color: transparent transparent transparent #007bff;
}

#contact {
  background-color: #f8f9fa;
}

#contact .card {
  border: none;
}

#contact .form-label {
  font-weight: 500;
}

#contact .form-control {
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#contact .form-control:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#contact .d-grid {
  display: grid;
  gap: 1rem; /* Adjust gap if needed */
}

#contact .btn-primary {
  text-align: center; /* Center the text inside the button */
}


#contact .btn-primary:hover {
  background-color: #0069d9;
  border-color: #0062cc;
}

/* Responsive adjustments for contact section */
footer {
  width: 100%;
  /* Option 1: Set a fixed height */
  /* height: 80px; */ /* Example: 80 pixels */
  /* Option 2: Set minimum height */
  min-height: 80px; /* Example: 80 pixels minimum */
  padding: 1rem 0; /* Add some padding for content inside the footer */
}
.container-fluid {
  flex: 1; /* Allow container to take available space */
}
footer a:hover {
  text-decoration: underline; /* Add underline on hover for footer links */
}

.social-links a {
  font-size: 1.5rem; /* Make social icons larger */
  margin: 0 0.5rem;
}

@media (max-width: 768px) {
  /* Hero Section */
  #hero {
      padding-top: 60px;
      min-height: auto;
  }

  .hero-content {
      padding: 1rem;
  }
  .typing-text {
      font-size: 2rem;
  }

  .timeline {
    padding: 1rem;
  }

  .timeline-item {
      flex-direction: column !important;
      align-items: center; /* Center items horizontally */
      padding: 0.5rem 0;
      margin-bottom: 1rem;
      width: 100%; /* Ensure full width on mobile */
      box-sizing: border-box; /* Include padding/border in width */
  }

  .timeline-date {
      margin-bottom: 0.5rem;
      padding: 0.5rem;
      box-sizing: border-box;
      word-wrap: break-word;
      max-width: 100%;
      text-align: center; /* Center the date text */
  }

  .timeline-content {
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
    max-width: 100%;
  }
  .timeline-content ul{
    padding-left: 20px;
  }

  /* Projects */
  .row.row-cols-1.row-cols-md-2.g-4 {
    flex-direction: column;
    align-items: center; /* Center project cards */
    padding: 1rem;
    width: 100%; /* Important: Ensure row takes full width */
    box-sizing: border-box;
  }

  .col {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    padding: 0 1rem;
    box-sizing: border-box;
  }
  .project-card{
    width: 100%;
  }
  .project-overlay p{
    font-size: 14px;
  }

  /* Contact */
  #contact .card {
    padding: 1rem;
    width: 100%; /* Ensure card takes full width */
    box-sizing: border-box;
  }
  #contact .form-control{
    max-width: 100%;
  }

  /* Footer */
  footer {
    padding: 1rem;
    box-sizing: border-box;
  }

  footer .row {
    flex-direction: column;
    text-align: center; /* Center footer content */
    width: 100%; /* Ensure row takes full width */
    box-sizing: border-box;
  }

  footer .col-md-4 {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0 1rem; /* Add horizontal padding to footer columns */
    box-sizing: border-box;
  }
  .social-links{
    justify-content: center;
  }
}