/* Gallery grid styles */
.galleries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 2rem;
  padding: 2rem;
  box-sizing: border-box;
}

.gallery-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0,0,0,0.1);
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.gallery-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #f8f9fa;
}

.gallery-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: white;
}

.gallery-name {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
  color: #2c3e50;
  font-weight: 600;
  line-height: 1.3;
}

.gallery-date {
  color: #666;
  font-size: 0.9rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* Gallery view styles */
.back-link {
  display: inline-block;
  margin: 1rem;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.gallery-title {
  margin: 1rem 1rem 2rem;
}

.gallery-description {
  margin: 1rem;
  line-height: 1.6;
}

/* new mansory css   */

#mansory-wraper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
  box-sizing: border-box;
}

#masonry-container {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.masonry-item {                                 
  position: relative;                     /* IMPORTANT FOR LAZY LOADING XDD */
}

.masonry-item.after-layout {        
  position: absolute;
}

.masonry-item-content {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}
.masonry-item a {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: 0px;       
  display: block;
  margin-bottom: 100%;                        /* IMPORTANT FOR LAZY LOADING XDD */
}

.masonry-item.after-layout div a {
  margin-bottom: 0;                            /* IMPORTANT FOR LAZY LOADING XDD */
} 

.masonry-item a:has(img.loaded) {
  height: 100%;                                /* IMPORTANT FOR LAZY LOADING XDD */ 
}

.masonry-item img {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.masonry-item img.loaded {
  opacity: 1;

}
.placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer {
  0% {
      background-position: 200% 0;
  }
  100% {
      background-position: -200% 0;
  }
}

/* backend css */
.btn.htmx-request {
  position: relative;
  overflow: hidden;
}

.btn.htmx-request::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
  animation: loading-wave 1s linear infinite;
  z-index: 1; 
  pointer-events: none; 
}

@keyframes loading-wave {
  from {
    left: -100%;
  }
  to {
    left: 100%;
  }
}

.image-toggleable:has(button.unapproved) img {
  opacity: 0.3;
  background-color: #888888;
}

/* Reviewer page square images */
.card img.card-img-top {
  aspect-ratio: 1;
  object-fit: contain;
  width: 100%;
  height: 100%;
  background-color: #f8f9fa;
}

/* Password form styles */
.password-form {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.1);
}

.password-form p {
  margin-bottom: 1.5rem;
  color: #666;
  text-align: center;
}

.password-form .text-danger {
  color: #dc3545;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.password-form .form-group {
  margin-bottom: 1rem;
}

.password-form .form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.password-form .form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.password-form .btn {
  width: 100%;
  padding: 0.75rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.password-form .btn:hover {
  background: #0056b3;
}

/* Sticky Footer Styles */
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}
