/* Portfolio Hero Section */
.portfolio-hero {
    background: linear-gradient(90deg, #d7b2c7, #6b5b73);;
    color: white;
    padding: 50px 20px 40px; /* Reduced vertical padding */
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portfolio-hero h1 {
    font-size: 2.2rem; /* Slightly smaller heading */
    margin-bottom: 0.8rem; /* Reduced margin */
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.portfolio-hero p {
    font-size: 1.1rem; /* Slightly smaller paragraph */
    max-width: 700px;
    margin: 0 auto 1.5rem; /* Reduced bottom margin */
    opacity: 0.9;
}

/* Search Bar */
.search-bar {
    max-width: 600px;
    margin: 1rem auto 0; /* Reduced top margin */
    display: flex;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-bar button {
    background: #d7b2c7;
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-bar button:hover {
    background: #c8a7ba;
}

/* Portfolio Filters */
.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1rem 0; /* Reduced margin */
    padding: 0 1rem; /* Reduced padding */
}

.filter-btn {
    background: #f3f4f6;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: #c8a7ba;
    color: white;
    transform: translateY(-2px);
}

.btn-view-more{
  background: #d7b2c7;
}

/* Gallery Grid */
.gallery {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 0rem;
  border-radius: 16px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Slightly smaller min width */
    gap: 20px; /* Reduced gap */
    padding: 10px 0; /* Reduced padding */
}

.project-card {
    background: white;
    border-radius: 10px; /* Slightly smaller radius */
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0; /* Ensure no extra margin */
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info {
    padding: 15px; /* Reduced padding */
}

.project-category {
    display: inline-block;
    background: #f0e9ff;
    color: #6b5b73;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem; /* Slightly smaller */
    font-weight: 600;
    margin-bottom: 6px; /* Reduced margin */
    text-align: left;
}

.project-title {
    font-size: 1.1rem; /* Slightly smaller */
    margin: 6px 0; /* Tighter margins */
    color: #1f2937;
}

.project-description {
    color: #6b7280;
    font-size: 0.9rem; /* Slightly smaller */
    line-height: 1.5;
    margin-bottom: 12px; /* Reduced margin */
}

/* Loading Spinner */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    max-width: 900px;
    margin: 40px auto;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    z-index: 10;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #1f2937;
}

.modal-body {
    padding: 25px; /* Reduced padding */
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #7c3aed;
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .portfolio-hero {
        padding: 40px 15px 30px;
    }
    
    .portfolio-hero h1 {
        font-size: 1.8rem;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .portfolio-filters {
        gap: 6px;
    }
    
    .filter-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
    
    .gallery {
        padding: 0.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}



.gallery h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2.5rem;
  color: #5b21b6; /* Deep purple text */
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.gallery h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
  margin: 1rem auto 0;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Shows 3 items per row */
  gap: 2rem;
  margin-top: 2rem;
}

.gallery-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f0e9ff;
  position: relative;
  z-index: 1;
}

.gallery-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.gallery-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.2);
}

.gallery-card:hover::before {
  opacity: 1;
}

.gallery-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease;
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.gallery-card:hover img {
  transform: scale(1.03);
}

.gallery-card .card-content {
  padding: 1.75rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  border-top: 1px solid #f5f3ff;
}

.gallery-card .card-content h3 {
  font-size: 1.4rem;
  margin: 0 0 1rem;
  color: #5b21b6; /* Deep purple text */
  font-weight: 700;
  line-height: 1.4;
  position: relative;
  padding-bottom: 0.75rem;
}

.gallery-card .card-content h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
  border-radius: 3px;
}

.gallery-card .card-content p {
  font-size: 1rem;
  color: #4b5563;
  margin: 1rem 0 1.5rem;
  line-height: 1.7;
  flex-grow: 1;
}

.gallery-card .card-content a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  background: #f9f5ff;
  color: #4c1d95;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid #e9d5ff;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-size: 0.95rem;
}

.gallery-card .card-content a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.gallery-card .card-content a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
  color: #4c1d95;
  border-color: #c4b5fd;
}

.gallery-card .card-content a:hover::before {
  opacity: 1;
}

/* Loading Spinner */
.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 0;
  color: #7c3aed;
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  margin: 1rem 0;
  backdrop-filter: blur(5px);
}

.loading-spinner::after {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  margin: 1.25rem auto 0;
  border: 4px solid #f3e8ff;
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.1);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery {
    padding: 1.5rem 1rem;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .gallery h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  .gallery-card {
    margin-bottom: 0;
  }
  
  .gallery-card .card-content {
    padding: 1.5rem;
  }
}