/* Theme Switcher UI Styles */

.theme-selector {
  position: relative;
  display: inline-block;
}

.theme-toggle-btn {
  background-color: var(--hover-overlay);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s, border-color 0.3s;
  white-space: nowrap;
}

.theme-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 250px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
}

.theme-dropdown.active {
  max-height: 500px;
  opacity: 1;
}

.theme-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--table-header);
}

.theme-dropdown-title {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.theme-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.theme-close-btn:hover {
  background-color: var(--border-color);
  color: var(--text-color);
}

.theme-list {
  padding: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.theme-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s;
  position: relative;
}

.theme-item:hover {
  background-color: var(--table-header);
}

.theme-item.active {
  background-color: var(--border-color);
}

.theme-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.theme-name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-color);
  font-weight: 500;
}

.theme-check {
  font-size: 1.2rem;
  color: var(--secondary-color);
  opacity: 0;
  transition: opacity 0.2s;
}

.theme-item.active .theme-check {
  opacity: 1;
}

/* Mobile Responsive Styles for Theme Switcher */
@media (max-width: 900px) {
  .theme-selector {
    width: 100%;
  }

  .theme-toggle-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 0;
    justify-content: center;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .theme-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
    min-width: unset;
    max-width: 100%;
  }

  .theme-dropdown.active {
    max-height: 80vh;
  }

  .theme-list {
    max-height: calc(80vh - 60px);
  }
}
