/* Global styles remain unchanged */
html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Header / Navbar Styles */
.header {
  background-color: #111111;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  color: #FF8C00;
}

/* Projects Section Styles */
.projects-section {
  position: relative;
  padding: 20px;
  background-color: #111111;
  text-align: center;
  overflow: hidden; /* To contain modal overlay */
}

.projects-section h2 {
  font-size: 2rem;
  margin-bottom: 40px;
}

/* Carousel Container */
.carousel-container {
  position: relative;
}

/* Updated Projects Grid as Carousel */
.projects-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 20px;
}

/* Hide scrollbar for WebKit browsers */
.projects-grid::-webkit-scrollbar {
  display: none;
}

/* Project Box */
.project-box {
  background-color: #1a1a1a;
  padding: 20px;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: block;
  color: inherit;
  min-width: 250px;
}

.project-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.project-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 15px;
}

.project-box h3 {
  font-size: 1.5rem;
  color: #FF8C00;
  margin-bottom: 10px;
}

.project-box p {
  font-size: 1rem;
  color: #BBBBBB;
}

/* Carousel Arrow Buttons */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #FF8C00;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  z-index: 5;
}

.carousel-arrow-left {
  left: 10px;
}

.carousel-arrow-right {
  right: 10px;
}

/* Modal / Expanded Project Styles */
.project-modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 17, 17, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 40px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  z-index: 10;
}

.project-modal.active {
  display: block;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2.5rem;
  font-weight: bold;
  color: #FF8C00;
  cursor: pointer;
}

/* Modal content container */
.modal-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

/* Modal header: title, image, and button in one row */
.modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

/* Container for title and button */
.modal-title-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Modal title and image */
#modalTitle {
  font-size: 1.5rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

.modal-header .modal-image {
  height: 2.4rem;
  width: auto;
  object-fit: cover;
}

/* Modal text content */
.modal-content p {
  font-size: 1rem;
  color: #BBBBBB;
  line-height: 1.6;
}

/* Gallery Styles */
.modal-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.gallery-image {
  max-width: 80%;
  max-height: 400px;
  border-radius: 4px;
  margin: 0 10px;
}

.gallery-arrow {
  background: none;
  border: none;
  color: #FF8C00;
  font-size: 2rem;
  cursor: pointer;
  user-select: none;
}

.gallery-arrow:focus {
  outline: none;
}

/* Go to Project Button Styles */
.project-link {
  display: inline-block;
  text-decoration: none;
}

/* IMPORTANT: Update your HTML for the go-to-project button so that the arrow and text are in separate spans */
.project-button {
  background-color: #FF8C00;
  color: #fff;
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-button:hover {
  background-color: #e67600;
}

.link-icon {
  height: 1.2rem;
  width: auto;
}

/* Responsive styles for small screens */
@media (max-width: 480px) {
  /* Scale down the header & navbar */
  .header {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px;
  }
  .logo {
    font-size: 1.2rem;
  }

  /* Scale down modal container */
  .project-modal {
    padding: 20px 10px;
  }
  .modal-content {
    max-width: 100%;
    font-size: 0.9rem;
  }
  .modal-header h3,
  #modalTitle {
    font-size: 1.5rem;
  }
  .modal-content p {
    font-size: 0.9rem;
  }
  .projects-section {
    height: 100%;
  }
  .carousel-arrow {
    font-size: 1.5rem;
    padding: 8px;
  }
  .modal-close {
    top: 10px;
    right: 10px;
    font-size: 2rem;
  }
  /* Scale down project boxes a bit */
  .project-box {
    padding: 15px;
    min-width: 200px;
  }
  .project-box h3 {
    font-size: 1.3rem;
  }
  .project-box p {
    font-size: 0.9rem;
  }

  /* Adjust the go-to-project button */
  .project-button {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
  .project-button .button-text {
    display: none; /* Hide text; only the arrow will display */
  }
  .project-button .arrow {
    font-size: 1rem;
  }
}
