#pimg-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

#pimg-gallery img {
    width: 100%;
    height: auto; /* ya jitni aapko chahiye */
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.pimg-masonry img {
    width: 100%;
    height: auto;
    margin-bottom: 1em;
    border-radius: 20px;
    display: block;
    transition: transform 0.3s ease;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.pimg-masonry img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Modal Styles */
.pimg-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.pimg-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 1000px;
    border-radius: 15px;
    position: relative;
}

.pimg-close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

.pimg-modal-body {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

#pimg-modal-image {
    max-width: 60%;
    height: auto;
    border-radius: 10px;
}

.pimg-details {
    flex: 1;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.pimg-details h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
}

.pimg-info {
    margin: 20px 0;
}

.pimg-info p {
    margin: 10px 0;
    color: #555;
}

.pimg-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(0, 114, 255, 0.15);
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    cursor: pointer;
    outline: none;
}

.pimg-download-btn:hover, .pimg-download-btn:focus {
    background: linear-gradient(90deg, #0072ff 0%, #00c6ff 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 24px rgba(0, 114, 255, 0.22);
}

.pimg-download-btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

#pimg-loading {
    text-align: center;
    padding: 15px;
    font-size: 16px;
    display: none;
}

/* Responsive columns */
@media (max-width: 1200px) {
    #pimg-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    .pimg-modal-body {
        flex-direction: column;
    }
    #pimg-modal-image {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    #pimg-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .pimg-modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    #pimg-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .pimg-masonry img {
        margin-bottom: 0.5em;
    }
    .pimg-ad-container {
        padding: 10px;
    }
}

@media (max-width: 600px) {
  #pimg-gallery, .pimg-masonry {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  #pimg-gallery img, .pimg-masonry img {
    width: 100% !important;
  }
  .pimg-ad-container {
    padding: 10px !important;
    grid-column: 1 / -1 !important;
  }
}

html, body {
  height: 100%;
  min-height: 100%;
}
#pimg-gallery {
  min-height: 100vh;
}

.pimg-modal-ad {
  background: #f7fafd;
  border: 1.5px solid #e3e8ee;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin: 18px 0 0 0;
  padding: 18px 10px 10px 10px;
  position: relative;
  min-height: 60px;
  text-align: center;
  transition: box-shadow 0.3s;
}
.pimg-modal-ad:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
}
.pimg-modal-ad-label {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: #007bff;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 12px;
  border-radius: 8px;
  letter-spacing: 1px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  z-index: 2;
  pointer-events: none;
}
@media (max-width: 600px) {
  .pimg-modal-ad {
    padding: 12px 4px 8px 4px;
    font-size: 14px;
  }
  .pimg-modal-ad-label {
    font-size: 10px;
    padding: 2px 8px;
  }
}

/* Classic Modal Redesign */
.classic-modal {
  border: none;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(44,62,80,0.22), 0 1.5px 8px rgba(44,62,80,0.10);
  background: #f9f9f9;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.classic-modal-header {
  background: #2d3e50;
  color: #fff;
  padding: 12px 20px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.classic-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
}
.classic-close {
  background: #fff;
  color: #2d3e50;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  width: 36px;
  height: 36px;
  text-align: center;
  line-height: 32px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(44,62,80,0.10);
}
.classic-close:hover {
  background: #e74c3c;
  color: #fff;
  box-shadow: 0 4px 16px rgba(231,76,60,0.18);
}
.classic-modal-body {
  display: flex;
  gap: 24px;
  padding: 24px 20px 20px 20px;
}
.classic-image-wrap {
  flex: 0 0 320px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.classic-image-wrap img {
  max-width: 300px;
  max-height: 380px;
  border: 1.5px solid #bfc9d1;
  border-radius: 6px;
  background: #fff;
}
.classic-details {
  flex: 1;
  background: none;
  border-radius: 0;
  padding: 0;
}
.classic-details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}
.classic-details-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #e0e6ed;
  font-size: 15px;
  color: #222;
}
.classic-details-table tr:last-child td {
  border-bottom: none;
}
#classic-download-btn-wrap {
  margin-bottom: 10px;
}
.classic-download-btn {
  background: #2d3e50;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(44,62,80,0.10);
  transition: background 0.2s;
}
.classic-download-btn:hover {
  background: #1abc9c;
  color: #fff;
}
.classic-modal-footer {
  background: #f1f3f6;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  padding: 10px 0 8px 0;
  text-align: center;
  font-size: 13px;
  color: #888;
}
.classic-modal-ad {
  margin-top: 10px;
}
@media (max-width: 900px) {
  .classic-modal-body {
    flex-direction: column;
    gap: 10px;
  }
  .classic-image-wrap {
    justify-content: flex-start;
    margin-bottom: 10px;
  }
}

/* Modal Animation */
.modal-animate-in {
  animation: modalPopIn 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes modalPopIn {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(40px);
  }
  60% {
    opacity: 1;
    transform: scale(1.03) translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

