:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --accent-color: #ff6f61;
  --text-color: #333;
  --background-color: #f4f4f4;
  --transition-speed: 0.4s;
  --shadow-color: rgba(0, 0, 0, 0.25);
  --hover-shadow: rgba(0, 0, 0, 0.35);
}

:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --accent-color: #ff6f61;
  --text-color: #333;
  --background-color: #f4f4f4;
  --transition-speed: 0.4s;
  --shadow-color: rgba(0, 0, 0, 0.25);
  --hover-shadow: rgba(0, 0, 0, 0.35);
}

/* Genel konteyner stili */
[id^="gallery-search-container-"] {
    position: relative;
    width: 300px;
    padding-top: 5px;
    margin: 20px auto;
    display: flex;
    justify-content: flex-end;
}

/* Arama ikonu stili */
[id^="gallery-search-container-"] .search-icon {
    position: relative;
    cursor: pointer;
    z-index: 2;
    color: var(--primary-color);
    transition: color 0.3s ease, background-color 0.3s ease;
    background: none;
    padding: 10px;
    border-radius: 50%;
}

[id^="gallery-search-container-"] .search-icon:hover {
    color: var(--accent-color);
}

[id^="gallery-search-container-"] .search-icon.active {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Arama input alanı stili */
[id^="gallery-search-container-"] .search-input-wrapper {
    position: absolute;
    right: 0;
    overflow: hidden;
    width: 40px;
    transition: width 0.3s ease, background-color 0.3s ease;
    background-color: transparent;
    border-radius: 20px;
    display: flex;
    justify-content: flex-end;
}

[id^="gallery-search-container-"] .search-input-wrapper.active {
    width: 100%;
    background-color: #f0f0f0;
}

[id^="gallery-search-container-"] .gallery-search {
    width: 100%;
    padding: 10px 40px 10px 10px;
    border: none;
    background-color: transparent;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    opacity: 0;
    cursor: pointer;
}

[id^="gallery-search-container-"] .search-input-wrapper.active .gallery-search {
    opacity: 1;
    cursor: text;
}

[id^="gallery-search-container-"] .gallery-search:focus {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Arama sonuçları stili */
[id^="gallery-search-results-"] {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    width: 100%;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

[id^="gallery-search-results-"].active {
    display: block;
}

[id^="gallery-search-results-"] div {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

[id^="gallery-search-results-"] div:hover {
    background-color: #f0f0f0;
}

[id^="gallery-search-results-"] div:first-child {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

[id^="gallery-search-results-"] div:last-child {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* Mobil düzen için medya sorgusu */
@media (max-width: 768px) {
    [id^="gallery-search-container-"] {
        width: 100%;
        max-width: 300px;
    }

    [id^="gallery-search-container-"] .search-icon {
        display: none;
    }

    [id^="gallery-search-container-"] .search-input-wrapper {
        width: 100%;
        position: static;
        background-color: #f0f0f0;
    }

    [id^="gallery-search-container-"] .gallery-search {
        opacity: 1;
        cursor: text;
        width: 100%;
        padding: 10px;
    }

    [id^="gallery-search-results-"] {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
        background-color: white;
        border: 1px solid #ddd;
        border-top: none;
    }
}

#custom-gallery {
  background-color: var(--background-color);
  padding: 3rem;
  font-family: "Poppins", Sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.breadcrumb {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed);
  font-weight: 600;
  letter-spacing: 0.05rem;
}

.breadcrumb a:hover {
  color: var(--accent-color);
}

#gallery-category-list,
#gallery-subcategory-list,
#gallery-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.gallery-category,
.gallery-subcategory,
.gallery-image {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 8px 15px var(--shadow-color);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed), filter var(--transition-speed);
  cursor: pointer;
}

.gallery-category:hover,
.gallery-subcategory:hover,
.gallery-image:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px var(--hover-shadow);
  filter: brightness(1.1);
}

.gallery-category img,
.gallery-subcategory img,
.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed), filter var(--transition-speed);
}

.gallery-category:hover img,
.gallery-subcategory:hover img,
.gallery-image:hover img {
  transform: scale(1.08);
  filter: brightness(0.95) blur(1px);
}

.gallery-category-name,
.gallery-subcategory-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  color: white;
  padding: 1.25rem;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.1rem;
  opacity: 0.9;
  transition: opacity var(--transition-speed), transform var(--transition-speed);
}

.gallery-category:hover .gallery-category-name,
.gallery-subcategory:hover .gallery-subcategory-name {
  opacity: 1;
}

.gallery-subcategory-name {
    background-color: #000000c9 !important;
}

/* PhotoSwipe özelleştirmeleri */
.pswp__bg {
  background-color: rgba(0, 0, 0, 0.9);
}

.pswp__button--arrow--left:before,
.pswp__button--arrow--right:before {
  background-color: rgba(255, 255, 255, 0.4);
  filter: blur(0px);
}

@media (max-width: 768px) {
    .gallery-search-container {
        width: 100%;
        max-width: 300px;
        position: relative;
    }

    .search-icon {
        display: none; /* Mobilde ikonu gizle */
    }

    .search-input-wrapper {
        width: 100%; /* Arama kutusunu tam genişlikte göster */
        position: static; /* Mutlak konumlandırmayı kaldır */
        background-color: #f0f0f0;
    }

    .gallery-search {
        opacity: 1;
        cursor: text;
        width: 100%;
        padding: 10px;
    }

    .gallery-search-results {
        position: absolute;
        top: 100%; /* Arama kutusunun hemen altında */
        left: 0;
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
        background-color: white;
        border: 1px solid #ddd;
        border-top: none;
        z-index: 1000;
    }

    .gallery-search-results.active {
        display: block;
    }

    .gallery-search-results div {
        padding: 10px;
        border-bottom: 1px solid #eee;
    }

    .gallery-search-results div:last-child {
        border-bottom: none;
    }

    #gallery-category-list,
    #gallery-subcategory-list,
    #gallery-images {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    #custom-gallery {
      padding: 1rem;
    }

    .breadcrumb {
      font-size: 0.9rem;
    }
}