/* ===================================
   Gallery Tree Slider Styles
   =================================== */

/* Search Panel Styling */
.search-panel {
  position: absolute;
  top: calc(25px + var(--SafeAreaInsetTop));
  left: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 2px 5px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 50px;
  height: 50px;
  z-index: 10000;
  transition: width 0.3s ease;
  cursor: pointer;
  box-shadow: 0 0px 10px rgba(0, 0, 0, 0.1);
}

.search-panel:not(.expanded) {
  justify-content: center;
  gap: 0;
  padding: 0;
}

.search-panel:not(.expanded) .search-input {
  position: absolute;
  pointer-events: none;
}

.search-panel.expanded {
  background: rgba(255, 255, 255, 1);
  cursor: default;
  padding: 0;
  gap: 0;
}

.search-panel.expanded.focused {
  width: 280px;
}

.search-panel.expanded.half {
  width: 140px;
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  opacity: 0.6;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease;
}

.search-icon img {
  display: block;
  filter: brightness(0);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.search-icon:hover {
  opacity: 0.75;
}

.search-icon:hover img {
  opacity: 0.65;
}

.search-icon-small {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
  width: 0;
  height: 16px;
  overflow: hidden;
  transition:
    opacity 0.3s ease,
    width 0.3s ease;
}

.search-icon-small img {
  width: 16px;
  height: 16px;
  display: block;
  filter: brightness(0);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.search-panel.expanded .search-icon-small {
  width: 16px;
  opacity: 0.6;
}

.search-panel.expanded .search-icon-small:hover {
  opacity: 0.75;
}

.search-panel.expanded .search-icon-small:hover img {
  opacity: 0.65;
}

.search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 20px;
  padding: 10px 5px;
  width: 0;
  color: #000000ff;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  cursor: text;
}

.search-panel.expanded .search-input {
  opacity: 1;
}

.search-panel.expanded.focused .search-input {
  width: 250px;
}

.search-panel.expanded.half .search-input {
  width: 110px;
}

.search-input::placeholder {
  color: #fffcfc73;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.5);
  font-size: 28px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  width: 0;
  height: 24px;
  opacity: 0;
  transition: opacity 0.3s ease, width 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-panel.expanded .search-clear {
  width: 24px;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-panel.expanded .search-clear:hover {
  opacity: 0.75;
  color: rgba(0, 0, 0, 0.65);
}

/* Tree Background */
.tree-background {
  width: 100%;
  height: 350px;
  background-image: url('../ui/bg-forest.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

/* Slider Wrapper */
.tree-slider-wrapper {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  height: 330px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  cursor: default;
  /* Move scrollbar to top */
  transform: rotateX(180deg);
}

/* Flip content back to normal */
.tree-row {
  transform: rotateX(180deg);
}

/* Show scrollbar with custom styling */
.tree-slider-wrapper::-webkit-scrollbar {
  height: 20px;
}

.tree-slider-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0px;
}

.tree-slider-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.tree-slider-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Tree Row - Scrollable */
.tree-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 35px;
  padding-left: 50%;
  padding-right: 0;
  height: 100%;
}

/* Tree Box */
.tree-box {
  cursor: pointer;
  transition: all 0.5s ease;
  flex-shrink: 0;
  text-align: center;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.tree-box:active {
  cursor: pointer;
}

.tree-image {
  height: 180px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition:
    height 0.5s ease,
    filter 0.5s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.tree-name {
  color: white;
  font-size: 20px;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  opacity: 0.8;
  pointer-events: none;
  user-select: none;
  transition: font-size 0.2s ease;
}

.tree-name-english {
  font-size: 14px;
  opacity: 0.7;
  margin-top: 2px;
  font-weight: 300;
}

/* Selected tree - bigger */
.tree-box.selected .tree-image {
  height: 220px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}

.tree-box.selected .tree-name {
  font-size: 25px;
  color: #fbff00ff;
  font-weight: 500;
  margin-bottom: 5px;
}

.tree-box.selected .tree-name-english {
  font-size: 16px;
  opacity: 0.8;
}

/* Navigation Arrows */
.tree-nav-arrow {
  position: absolute;
  top: calc(50px + var(--SafeAreaInsetTop));
  transform: translateY(-50%);
  z-index: 100;
  background: rgba(255, 255, 255, 0.2);
  border: 0px solid rgba(91, 155, 213, 0.3);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tree-nav-arrow:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.tree-nav-arrow:hover i {
  transform: none;
}

.tree-nav-left {
  right: calc(50px + 10px + 20px);
}

.tree-nav-right {
  right: 20px;
}

.tree-nav-arrow .fa-solid,
.tree-nav-arrow i {
  font-size: 20px;
  color: #4a7fb8;
}

/* Language Selector */
.language-nav {
  position: absolute;
  top: calc(50px + var(--SafeAreaInsetTop));
  transform: translateY(-50%);
  right: 8px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.2);
  border: 0px solid rgba(91, 155, 213, 0.3);
  height: 50px;
  width: 90px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-shadow: 0 0px 10px rgba(0, 0, 0, 0.1);
}

.language-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
}

.language-btn.active {
  opacity: 1;
}
