/* Základní stylování galerie */

.gao-gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system,
                 BlinkMacSystemFont,
                 "Segoe UI",
                 Roboto,
                 Oxygen-Sans,
                 Ubuntu,
                 Cantarell,
                 "Helvetica Neue",
                 sans-serif;
}

.gallery-filters {
  margin-bottom: 30px;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Stylování kategorií */

.gallery-categories {
  margin-bottom: 20px;
}

.gallery-categories h3, .gallery-tags h3 {
  font-size: 16px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  color: #333;
}

.gallery-category {
  display: inline-block;
  background-color: #f1f1f1;
  color: #333;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.gallery-category:hover, .gallery-category.active {
  background-color: var(--secondary, #4a89dc);
  color: #fff;
}

/* Stylování tagů */

.gallery-tags {
  display: block;
  margin: 15px 0;
}

.gallery-tag {
  display: inline-block;
  background-color: #f1f1f1;
  color: #333;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  margin-right: 6px;
  margin-bottom: 6px;
  transition: all 0.3s ease;
}

.gallery-tag:hover, .gallery-tag.active {
  background-color: var(--secondary, #4a89dc);
  color: #fff;
}

/* Grid pro galerii */

.gallery-grid {
  display: grid;
  grid-gap: 20px;
  margin-bottom: 40px;
}

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 4/3;
}

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

.gallery-item-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

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

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

.gallery-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
  text-align: center;
}

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

.gallery-item-overlay h3 {
  margin: 0 0 15px;
  font-size: 18px;
  color: white;
  font-weight: 500;
}

.show-formats-btn {
  background-color: var(--secondary, #4a89dc);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.show-formats-btn:hover {
  background-color: var(--tertiary, #5d9cec);
}

/* Modální okno */

.image-formats-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(3px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 90%;
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #000;
}

.image-preview {
  text-align: center;
  margin: 20px 0;
  max-height: 400px;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.image-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 5px;
  transition: transform 0.3s ease;
}

/* Nové stylování pro formáty s miniaturami */

.format-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.format-option {
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  opacity: 0; /* Začátek s neviditelným stavem pro animaci */
}

.format-option:hover {
  background-color: #f1f1f1;
  border-color: #ddd;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.format-option.active {
  background-color: #e9f1fd;
  border-color: #4a89dc;
  box-shadow: 0 0 0 2px rgba(74, 137, 220, 0.2);
}

.format-thumbnail {
  margin-bottom: 10px;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 5px;
  background-color: #eee;
  position: relative;
}

.format-thumbnail img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.format-thumbnail:hover img {
  transform: scale(1.05);
}

.format-info {
  text-align: center;
}

.format-name {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 15px;
}

.format-size {
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
}

.download-format-btn {
  background-color: var(--secondary, #4a89dc);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  transition: background-color 0.3s ease;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  text-align: center;
}

.download-format-btn:hover {
  background-color: var(--tertiary, #5d9cec);
  color: white;
  text-decoration: none;
}

/* Animace pro stahování */

.download-format-btn.downloading {
  background-color: #5cb85c;
}

/* Loading spinner */

.loading-spinner {
  display: block;
  width: 40px;
  height: 40px;
  margin: 20px auto;
  border: 4px solid #f3f3f3;
  border-radius: 50%;
  border-top: 4px solid #4a89dc;
  animation: spin 1s linear infinite;
}

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

  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  color: #d9534f;
  text-align: center;
  margin: 20px 0;
  padding: 10px;
  background-color: #f9f2f2;
  border-radius: 5px;
}

/* Responzivní design */

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
  }

  .format-options {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-category, .gallery-tag {
    font-size: 12px;
    padding: 6px 10px;
  }
}

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

  .format-options {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 15px;
    margin: 10% auto;
  }

  .image-preview {
    max-height: 300px;
  }

  .image-preview img {
    max-height: 300px;
  }

  .gallery-categories, .gallery-tags {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
  }
}
