/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
    background: #f8f4ff !important;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    overflow-x:hidden;
}

/* General Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.projects-section {
  width: 70%;
  margin: 0 auto;
  padding: 40px 0;
  text-align: center;
  margin-top: 6rem;
}

.projects-section h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #333;
}

.projects-intro {
  font-size: 1.1rem;
  color: #555;
  max-width: 800px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* Masonry Layout with CSS Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  grid-auto-rows: minmax(100px, auto);
}

.project-card {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.project-card h3 {
  font-size: 1.5rem;
  margin: 15px 0;
  color: #222;
  padding: 0 15px;
}

.project-card p {
  font-size: 1rem;
  color: #555;
  padding: 0 15px 15px;
  margin: 0;
  flex-grow: 1;
}

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 15px 15px;
}

.project-card .tags span {
  background: #e0e0e0;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #333;
}

/* Popup Modal */
.popup-modal {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100% - 80px);
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  overflow-y: auto;
}

.popup-content {
  position: relative;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  padding: 20px 0;
  border-radius: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Modern Close Button with Image */
.close-popup {
  position: absolute;
  top: 30px;
  right: 70px;
  cursor: pointer;
  width: 60px;
  height: 60px;
  z-index: 1001;
  transition: all 0.3s ease;
  opacity: 0.8;
  background-color: #BE0606; /* Updated to BE0606 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-popup:hover {
  opacity: 1;
  transform: scale(1.1);
  background-color: #BE0606; /* Updated to BE0606 */
}

/* Full-Width Image */
.popup-image-container {
  width: 100%;
  height: 600px;
  overflow: hidden;
  position: relative;
}

.popup-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Left-Aligned Header and Description */
.popup-text-container {
  display: flex;
  justify-content: space-between;
  margin: 20px 40px;
}

.popup-text-left {
  flex: 2;
  margin-right: 40px;
}

.project-title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #222;
}

.popup-description {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.6;
}

/* Right-Aligned Solutions Used */
.popup-solutions {
  flex: 1;
}

.popup-solutions h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #222;
}

.solutions-list {
  list-style-type: none;
  padding: 0;
}

.solutions-list li {
  background: #f1f1f1;
  padding: 10px;
  margin: 5px 0;
  border-radius: 4px;
  font-size: 1rem;
  border-left: 4px solid #BE0606; /* Updated to BE0606 */
}

/* Gallery Section */
.popup-gallery {
  margin: 40px;
}

.gallery-images {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.gallery-images img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.gallery-images img:hover {
  transform: scale(1.1);
  border-color: #BE0606; /* Updated to BE0606 */
}

/* Lightbox Styles */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1002;
  justify-content: center;
  align-items: center;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 3px solid #BE0606; /* Updated to BE0606 */
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  background-color: #BE0606; /* Updated to BE0606 */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1003;
  transition: all 0.3s ease;
}

.close-lightbox:hover {
  background-color: #BE0606; /* Updated to BE0606 */
  transform: scale(1.1);
}

/* Gallery Instruction Text */
.gallery-instruction {
  font-size: 0.9rem;
  color: #777;
  text-align: center;
  margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .projects-section {
    width: 90%;
  }

  .projects-section h2 {
    font-size: 2rem;
  }

  .projects-intro {
    font-size: 1rem;
  }

  .popup-text-container {
    flex-direction: column;
  }

  .popup-solutions {
    margin-top: 20px;
  }

  .gallery-images {
    grid-template-columns: repeat(2, 1fr);
  }

  .close-popup {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .popup-image-container {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .gallery-images {
    grid-template-columns: 1fr;
  }

  .popup-image-container {
    height: 300px;
  }
}