
.gallery-card {
  margin: 30px 0;
  position: relative;
  z-index: 1;
}

.gallery-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #1b4332, #2d6a4f, #40916c);
  border-radius: 10px 10px 0 0;
}


.gallery-card .card-title {
  text-align: center;
  margin-bottom: 20px;
  color: #1b4332;
  font-size: 1.8rem;
  border-bottom: none;
}

.gallery-card .card-title i {
  margin-right: 10px;
  color: #2d6a4f;
}


.section-subtitle {
  color: #6c757d;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 30px auto;
  text-align: center;
  line-height: 1.5;
}


.gallery-filters {
  margin-bottom: 30px;
}

.filters-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 25px;
  color: #495057;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.filter-btn:hover {
  border-color: #2d6a4f;
  color: #2d6a4f;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
  border-color: #2d6a4f;
  color: white;
  box-shadow: 0 4px 15px rgba(45, 106, 79, 0.3);
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  background: #f8f9fa;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .item-overlay {
  opacity: 1;
}

.item-title {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.item-meta {
  display: flex;
  gap: 15px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.item-category {
  background: rgba(45, 106, 79, 0.9);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 500;
}


.gallery-controls {
  margin: 20px 0;
}

.controls-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}


.gallery-card .btn {
  padding: 10px 25px;
  font-size: 15px;
}

.gallery-card .btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.gallery-card .btn-outline {
  background: transparent;
  border: 2px solid #2d6a4f;
  color: #2d6a4f;
}

.gallery-card .btn-outline:hover {
  background: #2d6a4f;
  color: white;
}

.btn-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 8px;
}


.gallery-info {
  margin-top: 30px;
}

.info-card {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #2d6a4f;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e9ecef;
}

.info-card i {
  color: #2d6a4f;
  font-size: 20px;
}

.info-card p {
  margin: 0;
  color: #495057;
  font-size: 14px;
}


.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

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

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.4s ease;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: white;
}

.modal-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-image-wrapper {
  position: relative;
  background: #f8f9fa;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-loader {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #6c757d;
}

.image-loader i {
  font-size: 40px;
  color: #2d6a4f;
}

.modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

.modal-image.loaded {
  display: block;
}

.image-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.nav-btn {
  pointer-events: all;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.modal-details {
  padding: 30px;
  overflow-y: auto;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f1f3f5;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.detail-item i {
  font-size: 24px;
  color: #2d6a4f;
  width: 40px;
}

.detail-label {
  display: block;
  color: #6c757d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  display: block;
  color: #1b4332;
  font-weight: 600;
  font-size: 16px;
}

.modal-description h4 {
  color: #1b4332;
  margin: 0 0 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-description h4 i {
  color: #2d6a4f;
}

.modal-description p {
  color: #495057;
  line-height: 1.6;
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.download-btn {
  background: #e3f2fd;
  color: #1565c0;
}

.download-btn:hover {
  background: #1565c0;
  color: white;
}

.share-btn {
  background: #e8f5e9;
  color: #2e7d32;
}

.share-btn:hover {
  background: #2e7d32;
  color: white;
}

.favorite-btn {
  background: #fce4ec;
  color: #c2185b;
}

.favorite-btn:hover {
  background: #c2185b;
  color: white;
}

.favorite-btn.active {
  background: #c2185b;
  color: white;
}

.modal-footer {
  padding: 15px 30px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.counter {
  color: #6c757d;
  font-weight: 500;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: #e9ecef;
  color: #495057;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 500;
}


@media (max-width: 992px) {
  .modal-content {
    grid-template-columns: 1fr;
    max-height: 85vh;
  }

  .modal-image-wrapper {
    min-height: 300px;
    max-height: 40vh;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }


  .modal-details {
    max-height: 45vh;
    overflow-y: auto;
    padding: 20px;
  }
}


@media (max-width: 768px) {
  .gallery-card .card-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .section-subtitle {
    font-size: 1rem;
    padding: 0 10px;
  }

  .filters-container {
    padding: 10px;
    gap: 8px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }


  .modal-container {
    width: 95% !important;
    max-height: 95vh !important;
    border-radius: 10px;
  }

  .modal-header {
    padding: 15px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .modal-title {
    font-size: 1.2rem;
    text-align: left;
    width: 100%;
  }

  .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .modal-image-wrapper {
    min-height: 250px;
    max-height: 35vh;
  }

  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .modal-details {
    padding: 15px;
    max-height: 50vh;
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 20px;
  }

  .detail-item {
    gap: 12px;
  }

  .detail-item i {
    font-size: 20px;
    width: 30px;
  }

  .detail-label {
    font-size: 11px;
  }

  .detail-value {
    font-size: 14px;
  }

  .modal-description h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
  }

  .action-btn {
    min-width: 100%;
    padding: 10px 15px;
    font-size: 14px;
  }

  .modal-footer {
    padding: 10px 15px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .counter {
    font-size: 14px;
  }

  .tags {
    width: 100%;
    justify-content: flex-start;
  }


  .controls-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .gallery-card .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .info-card {
    padding: 12px;
    gap: 10px;
  }

  .info-card i {
    font-size: 18px;
  }

  .info-card p {
    font-size: 13px;
  }
}


@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery-card {
    padding: 20px 15px;
  }

  .gallery-card .card-title {
    font-size: 1.3rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }


  .modal-container {
    width: 98% !important;
    height: 95vh;
    border-radius: 8px;
  }

  .modal-header {
    padding: 12px 15px;
  }

  .modal-title {
    font-size: 1.1rem;
    padding-right: 40px;
  }

  .modal-image-wrapper {
    min-height: 200px;
    max-height: 30vh;
  }

  .image-nav {
    padding: 0 10px;
  }

  .nav-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .modal-details {
    padding: 12px;
    max-height: 55vh;
  }

  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .detail-item i {
    font-size: 18px;
  }

  .modal-description p {
    font-size: 14px;
    line-height: 1.5;
  }

  .tag {
    font-size: 11px;
    padding: 3px 10px;
  }


  .filters-container {
    padding: 8px;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .filter-btn i {
    font-size: 12px;
  }
}


@media (max-height: 600px) and (orientation: landscape) {
  .modal-container {
    max-height: 85vh;
  }

  .modal-content {
    grid-template-columns: 1fr 1fr;
    max-height: 70vh;
  }

  .modal-image-wrapper {
    min-height: 200px;
    max-height: 50vh;
  }

  .modal-details {
    max-height: 50vh;
  }
}


@media (hover: none) and (pointer: coarse) {
  .gallery-item:hover {
    transform: none;
  }

  .filter-btn:hover,
  .btn:hover,
  .action-btn:hover {
    transform: none;
  }

  .filter-btn:active,
  .btn:active,
  .action-btn:active {
    transform: scale(0.98);
  }


  .filter-btn,
  .btn,
  .action-btn,
  .nav-btn,
  .modal-close {
    min-height: 44px;
  }

  .filter-btn {
    padding: 12px 20px;
  }
}
